Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: cyblox_boi

Problemset: Tired To Walk

Language: cpp

Time: 0.004 second

Submitted On: 2025-12-29 21:13:39

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

struct Map
{
    double x, y;
};

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    double scale, speed;
    cin >> scale >> speed;

    Map currentPosition = {0, 0};

    for (int i = 0; i < 4; i++)
    {
        int temp;
        cin >> temp;

        if (i % 2 == 0)
        {
            currentPosition.y += temp;
        }
        else
        {
            currentPosition.x += temp;
        }
    }

    double distance = scale * sqrt(pow(currentPosition.x, 2) + pow(currentPosition.y, 2));
    double time = distance / (speed * 18/5);
    int hour = floor(time);

    time -= hour;

    int minute = ceil(time * 60);

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

    return 0;
}