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

Problem_ID: B
Result: Accepted
Time: 5ms
Memory: 1092kB
Author: 2018212212078
In contest: 1272

#include <stdio.h>
int main(void){
int a,b,c;
scanf("%d%d",&a,&b);
if(a>0)
b=-b;
else
	b=2*b;
if (b%2!=0){
if(a*b<0)
a=-a;
}
else
	if(a*b>0)
		a=-a;
c=a-b;
printf("%d\n",c);
return 0;

}