Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Pera

Problemset: Tired To Walk

Language: cpp

Time: 0.002 second

Submitted On: 2025-09-03 10:10:50

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);

    int scale, speed;
    cin >> scale >> speed;

    int y1, x1, y2, x2;
    cin >> y1 >> x1 >> y2 >> x2;

    double distance = (static_cast<double>(scale)) * (sqrt(pow(static_cast<double>(x1 + x2), 2) + (pow(static_cast<double>(y1 + y2), 2))));

    double time_h = distance / (speed * (18.0/5.0));

    int hour = static_cast<int>(time_h);
    int minute = static_cast<int>(ceil((time_h - hour) * 60.0));

    cout << hour << " hr " << minute << " min\n";
}