fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. long long int t,n,i,j,k,g,h,m,o,p;
  7. vector<int> a,b;
  8. cin>>t;
  9. while(t--)
  10. {
  11. cin>>n>>m;
  12. g=24-n;
  13. g=g*60-m;
  14. cout<<g<<"\n";
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 5412KB
stdin
5
23 55
23 0
0 1
4 20
23 59
stdout
5
60
1439
1180
1