Problem : 2058 ( The sum problem ) Judge Status : Accepted
RunId : 2716000 Language : C++ Author : huwenbiao
Code Render Status : Rendered By HDOJ C++ Code Render Version 0.01 Beta
RunId : 2716000 Language : C++ Author : huwenbiao
Code Render Status : Rendered By HDOJ C++ Code Render Version 0.01 Beta
/***************************************************************\
*Author:Hu Wenbiao
*Created Time: Fri 30 Jul 2010 11:14:32 AM CST
*File Name: main.cpp
*Description:简单数学题
\***************************************************************/
//*========================*Head File*========================*\\
#include<iostream>
#include<stdio.h>
#include<math.h>
/*----------------------*Global Variable*----------------------*/
int N,M,len,tem;
//*=======================*Main Program*=======================*//
using namespace std;
int main(){
//freopen("input","r",stdin);
while(scanf("%d%d",&N,&M)!=EOF&&N&&M){
len=sqrt(2.0*M);//子串长度
for(;len;len--){
tem=M-(len+1)*len/2;
if(tem%len)
continue;
printf("[%d,%d]\n",tem/len+1,tem/len+len);
}
printf("\n");
}
}