pastebin

Paste Search Dynamic
Recent pastes
isgreaterequal
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. typedef long long ll;
  5.  
  6. const int N = 2e5 + 4 ;
  7. const int MOD =1e9 + 7 ;
  8.  
  9. int main()
  10. {
  11.     cin.tie(0);cin.sync_with_stdio(0);
  12.     cout.tie(0);cout.sync_with_stdio(0);
  13.  
  14.     int t = 1;
  15.     cin >> t;
  16.  
  17.     bool pr =0 ;
  18.  
  19.     while(t--)
  20.     {
  21.  
  22.         string s;
  23.        
  24.         int x ,y ;
  25.         cin >> x >> y;
  26.        
  27.         getline(cin, s);
  28.  
  29.         double ans =0 ;
  30.        
  31.  
  32.         while (getline(cin, s)){
  33.  
  34.             if (s.empty()) break;
  35.  
  36.             stringstream ss(s);
  37.  
  38.             ll x1 , x2 , y1 , y2  ;
  39.             ss >> x1 >> y1 >> x2 >> y2;
  40.  
  41.             ans += sqrt( ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
  42.         }
  43.  
  44.         if(pr) cout << "n" ;
  45.  
  46.         pr= 1 ;
  47.  
  48.         ans *= 2 ;
  49.         ans /= 1000 ;
  50.         ans /= 20 ;
  51.  
  52.  
  53.         double minutes = ans - (ll)floor(ans) ;
  54.  
  55.         ans = (ll)floor(ans) ;
  56.  
  57.         minutes *= 60 ;
  58.         minutes = round(minutes ) ;
  59.  
  60.         if (isgreaterequal( minutes , 60  ) )ans++ , minutes= 0 ;
  61.  
  62.         cout << ans << ":" ;
  63.  
  64.         cout << setfill('0') << setw(2) << minutes << 'n';
  65.  
  66.     }
  67.  
  68.     return 0;
  69. }
Parsed in 0.020 seconds