I read on some blog that the solution to this problem is as follows:
given below code is for games spoj or how many games spoj.
simpe logic behind this is we can write a fraction number into its lowest fraction and we have to just print denominator .
eg:
lets take 5.5 now we can write this as 55/10 now we calculate the gcd of 55 and 10 which is 5 and then divide the denominator by 5. and thats the answer.
But I don’t get the logic for this. Can someone please explain what’s the intuition behind this logic?