Problem: http://www.spoj.com/problems/GAMES/ My solution is giving right answer for the test cases given in the question and the cases which i tried but i m still getting wrong answer.May be there is some problem related to precision but i m not able to find the bug. Please help.

#include < iostream>

#include < cmath>

using namespace std;## include < stdio.h>

bool inline isInt(long double avg)

{

long double eps=0.0001;

if((avg-floor(avg))<eps)

return true;

`return false; }`

`int main() { long int t,i=1; long double avg,dup; scanf("%ld",&t); while(t--) { i=1; cin>>avg; dup=avg; while(isInt(dup)==false) { dup=avg; i=i+1; dup=dup*i; } cout<<i<<"\n"; } return 0; }`