ProblemA
题目:
样例:
注意:
#include <stdio.h>
void calculate()
{
int x,y,k,distance;
scanf("%d %d %d",&x,&y,&k);
distance = y - x;
if(x >= y)
{
printf("%d\n",x);
}else if (x < y)
{
if (distance > k)
{
printf("%d\n",2*y - x - k);
}else if (distance <= k)
{
printf("%d\n",y);
}
}
}
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
calculate();
}
return 0;
}