Making Friends

This is a companion discussion topic for the original entry at

This question is poorly worded. It is not clear whether N is the class size before or after Byang has joined the class.

Also, if you were to join a new school and try this method, I would be willing to bet that you would make precisely zero friends; there is a big leap between “Byang plans to make friends…” and “count how many friends he will make”. This requires clarification, such as “Assuming Byang is successful in making friends with everyone he wants to…”.

the entire math is not coded properly like what
I have to divide the input number of N by 2 3 5 or what

The problem is not described properly but the code is right … you have to count the divisors of N … and the number of divisors is the number of friends he will make… hope you’d understand…
Happy Coding !

According to the problem, if the number of students be 6 then Byang’s roll number should be 7 and in that case the output should be 1 since only 1 is divisor of 7 !!!

1 Like