#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <sstream>
using namespace std;
int main(){
ios::sync_with_stdio(0);
int t;
cin>>t;
while(t--){
double sum=0;
string s;
int x;
cin>>x>>x;
ws(cin);
getline(cin,s);
while(s.size()>0){
stringstream ss(s);
double x1,y1,x2,y2;
ss>>x1>>y1>>x2>>y2;
sum+=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if(cin.eof())
break;
getline(cin,s);
}
sum*=6;
sum/=1000;
int hr=round(sum)/60,mn=int(round(sum))%60;
cout<<hr<<":";
if(mn<10)
cout<<0;
cout<<mn<<endl;
if(t)
cout<<endl;
else
return 0;
}
}
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <sstream>
using namespace std;
int main(){
ios::sync_with_stdio(0);
int t;
cin>>t;
while(t--){
double sum=0;
string s;
int x;
cin>>x>>x;
ws(cin);
getline(cin,s);
while(s.size()>0){
stringstream ss(s);
double x1,y1,x2,y2;
ss>>x1>>y1>>x2>>y2;
sum+=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if(cin.eof())
break;
getline(cin,s);
}
sum*=6;
sum/=1000;
int hr=round(sum)/60,mn=int(round(sum))%60;
cout<<hr<<":";
if(mn<10)
cout<<0;
cout<<mn<<endl;
if(t)
cout<<endl;
else
return 0;
}
}
Comments
Post a Comment