fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin >> t;
  7. while(t--)
  8. {
  9. int a,b;
  10. cin >> a >> b;
  11. int c = (23-a) ;
  12. int d = (60-b);
  13. int w = c*60 + d;
  14. cout << w << endl;
  15.  
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 5320KB
stdin
5
23 55
23 0
0 1
4 20
23 59
stdout
5
60
1439
1180
1