/*
ID:18861501
LANG:C++
TASK:ariprog
*/
/*------------------Header Files------------------*/
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <ctype.h>
#include <cmath>
#include <stack>
#include <queue>
#include <map>
#include <vector>
#include <limits.h>
using namespace std;
/*------------------Definitions-------------------*/
#define LL long long
#define PI acos(-1.0)
#define INF 0x3F3F3F3F
/*---------------------Work-----------------------*/
int flag[125010];
void work()
{
int N,M;
scanf("%d%d",&N,&M);
memset(flag,0,sizeof(flag));
for(int i=0;i<=M;i++)
for(int j=i;j<=M;j++)
flag[i*i+j*j]=1;
bool flag1=true;
int limit=2*M*M;
for(int i=1;i<=limit/(N-1);i++)
{
for(int j=0;j+(N-1)*i<=limit;j++)
{
int cnt=0;
for(int temp=j;temp<=limit;temp+=i)
{
if(flag[temp]) cnt++;
else break;
if(cnt==N) break;
}
if(cnt==N)
{
flag1=false;
printf("%d %d\n",j,i);
}
}
}
if(flag1)
printf("NONE\n");
}
/*------------------Main Function------------------*/
int main()
{
//freopen("test.txt","r",stdin);
freopen("ariprog.out","w",stdout);
freopen("ariprog.in","r",stdin);
work();
return 0;
}
1.4.1(extra)
最新推荐文章于 2024-02-18 22:49:27 发布