标签:
原题地址:http://acm.hdu.edu.cn/showproblem.php?pid=2058
1 #include <iostream> 2 #include <math.h> 3 using namespace std; 4 int main() 5 { 6 __int64 m, n; 7 while(cin >> n >> m, n||m) 8 { 9 __int64 a, k; 10 for(k=(int)sqrt(2*m); k>0; k--) 11 { 12 a = m/k-(k-1)/2; 13 if((2*a-1+k)*k == 2*m) 14 cout << "[" << a << "," << k+a-1 << "]" << endl; 15 } 16 cout << endl; 17 } 18 return 0; 19 }
标签:
原文地址:http://www.cnblogs.com/forerve/p/4339599.html