0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-25 19:52:02 +00:00
OI-codes/Luogu/T216907/T216907.cpp

24 lines
408 B
C++
Raw Normal View History

2021-12-19 08:25:49 +00:00
#include <iostream>
2022-06-01 01:45:41 +00:00
#include <algorithm>
2021-12-19 08:25:49 +00:00
using std::cin;
using std::cout;
using std::endl;
int t, a, p;
int main() {
cin >> t;
while (t--) {
cin >> a >> p;
if (p < 16) {
cout << std::max(0, a - 10) << endl;
} else if (p > 20) {
cout << std::max(0, a - p + 20) << endl;
} else {
cout << a << endl;
}
}
return 0;
}