Start: Jun, 05, 2019 15:00:00
2019春ACM通识课考试(第二场)
End: Jun, 05, 2019 18:00:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 8ms
Memory: 1712kB
Author: 2018212212154
In contest: 1271

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring>
#include<queue>
#include<set>
using namespace std;
int main()
{
	int n,m;
	cin>>n>>m;
	if(n>m/2||m%2==1) printf("No answer");
	else
	{
		int f=0;
		for(int i=0;i<=n;++i)
		{
			for(int j=n-i;j<=n;++j)
			{
				if(i+2*j==m/2)
				{
					f=1;
					printf("%d %d",i,j);
					return 0;
				}
			}
		}
		if(f==0) printf("No answer");
	}
}