|
|
back to boardPlease, help... Lilo Dallas... Multipass... WA on 5 test :( #include <stdlib.h> #include <string.h> #include <math.h> int main() { long n,i,a,n0; double fa; scanf ("%lli", &n); for (i=3*sqrt(n); i>0; i--) { fa=(n)/(double)i - ((double)i-1)/2.0; a=fa; /*printf("fa=%f a=%li p=%li\n",fa,a,i);*/ n0=((2*a+i-1)*i )/2; if (n0==n && a>0) {printf("%li %li\n", a, i); return 0;} } printf ("%li 1\n",n); return 0; } |
|
|