#include<bits/stdc++.h>
using namespace std;
int main ()
{
	int n,i,j;
	cin>>n>>i>>j;
	bool first=true;
	for(int a=1;a<=n;a++)
	{
		if(!first)
		cout<<" ";
		cout<<"("<<i<<","<<a<<")";
		first=false;
	}
	cout<<endl;
	first=true;
	for(int b=1;b<=n;b++)
	{
		if(!first)
		cout<<" ";
		cout<<"("<<b<<","<<j<<")";
		first=false;
	}
	cout<<endl;
	first=true;
	for(int x=1;x<=n;x++)
	{
		int y=x-(i-j);
		if(y>=1&&y<=n)
		{
			if(!first)
			cout<<" ";
			cout<<"("<<x<<","<<y<<")";
			first=false;
		}
	} 
	cout<<endl;
	first=true;
	for(int x=n;x>=1;x--)
	{
		int y=(i+j)-x;
		if(y>=1&&y<=n)
		{
			if(!first)
			cout<<" ";
			cout<<"("<<x<<","<<y<<")";
			first=false;
		}
	}
	cout<<endl;
	return 0;
}

0 comments

No comments so far...

Information

ID
600
Time
1000ms
Memory
256MiB
Difficulty
6
Tags
(None)
# Submissions
247
Accepted
76
Uploaded By