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: 2018212212013
In contest: 1277

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<string>
using namespace std;
int main(){
	/*int T,a,Ta,b,Tb,tm,ts;
	char s;
	cin>>T;
	while(T--){
		cin>>a>>Ta>>b>>Tb>>tm>>s>>ts;
	}
	*/
	int a,b,t;
	cin>>a>>b;
	if(a>0)	b=-b;
	else	b*=2;
	if((b%2==0&&a*b>0)||(b%2!=0&&a*b<0))	a=-a;
	cout<<a-b<<endl;
	//system("pause");
	return 0;
}