fork download
  1. /*
  2.  *
  3.  */
  4. #include <bits/stdc++.h>
  5. using namespace std;
  6. #define ll long long
  7. #define int long long
  8. #define el '\n'
  9. #define all(v) v.begin(), v.end()
  10. const int mod = 1000000000 + 7, OO = 0x3f3f3f3f;
  11. const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
  12. const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
  13. const char di[] = {'U', 'R', 'L', 'D'};
  14.  
  15. void solve() {
  16.  
  17. int n, m;
  18. cin >> n >> m;
  19. int ans = (24 - (n + 1)) * 60 + (60 - m);
  20. cout << ans << el;
  21.  
  22. }
  23.  
  24.  
  25. int32_t main() {
  26. ios_base::sync_with_stdio(false);
  27. cout.tie(nullptr), cin.tie(nullptr);
  28.  
  29. // if(fopen("in.txt", "r")){
  30. // freopen("in.txt", "r", stdin);
  31. // freopen("out.txt", "w", stdout);
  32. // }
  33.  
  34. int tt = 1;
  35. cin >> tt;
  36. while (tt--) {
  37. solve();
  38. }
  39.  
  40. return 0;
  41. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
-1137355273726471776