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: 5ms
Memory: 2104kB
Author: 2018212212189
In contest: 1271

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 1e5+5;
int arr[maxn];
#define mst(a,b) memset(a,b,sizeof a)
int main(int argc, char const *argv[])
{
	int n,m,x;
	cin>>n>>m;
	int ans1,ans2;
	if(n*2==m){cout<<n<<" "<<"0"; return 0;}
	for(x=0;x<=n;++x){
		int y=n-x;
		if(2*x+4*y==m){
			break;
		}
	}
	if(x==n+1) cout<<"No answer";
	else cout<<x<<" "<<n-x;
	return 0;
}