题解:P16336 「ALFR Round 10」Another Add Problem
TvT终于抢到了
思路看代码吧
#include<iostream>
using namespace std;
int main() {
int t;
cin >> t;
#define f(i,a,b,x) for(int i=a;i<=b;i+=x)
f(i, 1, t, 1) {
int n, m, k;//不解释
cin >> n >> m >> k;
if (m == 0)cout << n << endl;//m=0则不能操作
else if (m > k - n % k)cout << 0 << endl;//能否等于0?
else cout << n % k << endl;//不解释
}
}
bro的第一篇题解,轻喷tvt