#include<bits/stdc++.h>
#define L long long
using namespace std;
const L m=1000000000000000000ll;
L a,b,c,d,n,p;
inline L orz(L c,L a,L b)
{
if(a==-1 || b==-1 || m/c<(a+b))
return -1;
else
return c*(a+b);
}
int main()
{
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
int i;
scanf("%lld%lld%lld%lld",&a,&b,&c,&n);
if(n&1)
printf("%lld\n",b-a);
else
printf("%lld\n",a-b);
return 0;
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:18:39: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld%lld%lld%lld",&a,&b,&c,&n);
^