mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-30 21:36:27 +00:00
24 lines
408 B
C++
24 lines
408 B
C++
#include <iostream>
|
|
#include <algorithm>
|
|
|
|
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;
|
|
}
|