https://hack.codingblocks.com/contests/c/547/1158
Can you please explain me the first test case ?
It says there are two piles of height 1 and 2.
Statement of question ==> Player will randomly choose 1 pile whose height is A and break it into B new piles each with stones A/B such that B is a divisor of A and B != A ( 1<= B < A)."
As it says pile of height 2 can be break into 1 new piles into 1 new pile with 2/1=2 stones in this pile such that 1 is the divisor of 2.
Which makes no sense and leads to infinite loop and every prime number will stuck like this…