Ps: Now the Death Knight hopes that you can help him calculate the minimum tip he wants to tip the goblin merchant.
[Plain] # include <stdio. h>
Int main ()
{
Int I;
Int j;
Int k;
Int n;
Int m;
Int l;
Int num;
Int max;
Int cost;
Int money;
Scanf ("% d", & num );
While (num --)
{
Scanf ("% d", & money );
N = currency/350;
M = money/200;
L = money/150;
Max = 0;
For (I = 0; I <= n; I ++)
{
For (j = 0; j <= m; j ++)
{
For (k = 0; k <= l; k ++)
{
Cost = I * 350 + j * 200 + k * 150;
If (cost> max & cost <= money)
{
Max = cost;
}
}
}
}
Printf ("% d", money-max );
If (num> 0)
{
Printf ("\ n ");
}
}
}
# Include <stdio. h>
Int main ()
{
Int I;
Int j;
Int k;
Int n;
Int m;
Int l;
Int num;
Int max;
Int cost;
Int money;
Scanf ("% d", & num );
While (num --)
{
Scanf ("% d", & money );
N = currency/350;
M = money/200;
L = money/150;
Max = 0;
For (I = 0; I <= n; I ++)
{
For (j = 0; j <= m; j ++)
{
For (k = 0; k <= l; k ++)
{
Cost = I * 350 + j * 200 + k * 150;
If (cost> max & cost <= money)
{
Max = cost;
}
}
}
}
Printf ("% d", money-max );
If (num> 0)
{
Printf ("\ n ");
}
}
}
Result chart: