Description
A crow is sitting on a branch with a piece of cheese in its mouth.
A fox is running by:
“Crow, are you going to the election?”
“No!”
The cheese falls down. The crow sits thinking:
“Would anything have changed had I said yes?”
A fox is running by:
“Crow, are you going to the election?”
“No!”
The cheese falls down. The crow sits thinking:
“Would anything have changed had I said yes?”
A Chukcha set out to go to the election. There are
l kilometers between his yaranga and the polling station. His deer run so that they cover every
k-kilometer segment of the way in exactly
h hours. What is the minimal and maximal time in which the Chukcha will be able to perform his civic duty?
Input
The only input line contains space-separated integers
l,
k, and
h (1 ≤
k ≤
l ≤ 1000; 1 ≤
h ≤ 1000).
Output
Output the minimal and maximal time in which Chukcha can get from his yaranga to the polling station, accurate to at least 10
–5. The numbers must be separated with a space.
Sample Input
input | output |
---|---|
30 10 1 | 3.00000000 3.00000000 |
#include <iostream>
#include <cstdio>
using namespace std;
void input()
{
int l, k, h;
cin >> l >> k >> h;
int ans = l % k ? l / k + 1 : l / k;
printf("%.8lf %.8lf\n", (double)(l / k * h), (double)ans * h);
}
int main()
{
std::ios::sync_with_stdio(false);
input();
return 0;
}