SP14834 FOXLINGS - Foxlings
Description
It’s Christmas time in the forest, and both the Fox and the Wolf families are celebrating. The rather large Fox family consists of two parents as well as $ N $ ( $ 1 \leq N \leq 10^9 $ ) little Foxlings. The parents have decided to give their children a special treat this year – crackers! After all, it’s a well-known fact that Foxen love crackers.
With such a big family, the parents can’t afford that many crackers. As such, they wish to minimize how many they give out, but still insure that each Foxling gets at least a bit. The parents can only give out entire crackers, which can then be divided and passed around.
With this many children, not all of them know one another all that well. The Foxlings have names, of course, but their parents are computer scientists, so they have also conveniently numbered them from $ 1 $ to $ N $ . There are $ M $ ( $ 1 \leq M \leq 10^5 $ ) unique two-way friendships among the Foxlings, where relationship $ i $ is described by the distinct integers $ A_i $ and $ B_i $ ( $ 1 \leq A_i,B_i \leq N $ ), indicating that Foxling $ A_i $ is friends with Foxling $ B_i $ , and vice versa. When a Foxling is given a cracker, he can use his tail to precisely split it into as many pieces as he wants (the tails of Foxen have many fascinating uses). He can then pass these pieces around to his friends, who can repeat this process themselves.
Input Format
Line $ 1 $ : 2 integers, $ N $ and $ M $
Next $ M $ lines: 2 integers, $ A_i $ and $ B_i $ , for $ i=1..M $
Output Format
A single integer – the minimum number crackers must be given out, such that each Foxling ends up with at least a small part of a cracker.