Start: Jul, 01, 2019 08:30:00
2019年度暑期短学期第四天
End: Jul, 01, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: G
Result: Accepted
Time: 4ms
Memory: 1756kB
Author: 2018212212289
In contest: 1277

#include<bits/stdc++.h>
using namespace std;
int main (){
	int a,b;
	cin>>a>>b;
	if(a>0)
	b=-b;
	else
	b*=2;
	if(abs(b)%2==1){
		if(b>0)
		a=abs(a);
		else
		a=-abs(a);
	}
	else{
		if(b>0)
		a=-abs(a);
		else
		a=abs(a);
	}
	cout<<a-b<<endl;
	return 0;
}