Problem Type : Ad hoc
#include<cstdio>
using namespace std;
int K, N, M, a, b;
int main()
{
while(scanf("%d",&K)==1)
{
if(K == 0) break;
scanf("%d %d", &N, &M);
for(int i = 0; i < K; i++)
{
scanf("%d %d", &a, &b);
if(a == N || b == M)
printf("divisa\n");
else if(a > N && b > M)
printf("NE\n");
else if(a < N && b > M)
printf("NO\n");
else if(a > N && b < M)
printf("SE\n");
else
printf("SO\n");
}
}
return 0;
}
#include<cstdio>
using namespace std;
int K, N, M, a, b;
int main()
{
while(scanf("%d",&K)==1)
{
if(K == 0) break;
scanf("%d %d", &N, &M);
for(int i = 0; i < K; i++)
{
scanf("%d %d", &a, &b);
if(a == N || b == M)
printf("divisa\n");
else if(a > N && b > M)
printf("NE\n");
else if(a < N && b > M)
printf("NO\n");
else if(a > N && b < M)
printf("SE\n");
else
printf("SO\n");
}
}
return 0;
}
No comments:
Post a Comment