fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int t;
  7. cin >> t;
  8. for(int i=0; i<t; i++) {
  9. int h,m;
  10. cin >> h >> m;
  11. cout << (23-h)*60 + 60-m << endl;
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 4496KB
stdin
5
23 55
23 0
0 1
4 20
23 59
stdout
5
60
1439
1180
1