标签:
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 20505 Accepted Submission(s): 6023
1 #include <cstdio> 2 #include <cmath> 3 4 int n,m; 5 6 int main() 7 { 8 while(scanf("%d%d",&n,&m), n){ 9 for(int num = (int)sqrt(m*2.0); num>0; --num){ 10 int numa1 = m-num*(num-1)/2; 11 if(numa1%num == 0) 12 printf("[%d,%d]\n",numa1/num,numa1/num+num-1); 13 } 14 printf("\n"); 15 } 16 return 0; 17 }
标签:
原文地址:http://www.cnblogs.com/inmoonlight/p/5166284.html