Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Created by fpdjsns
- // Copyright © 2019 fpdjsns. All rights reserved.
- //
- /*
- * 시간복잡도 : O(N)
- */
- #include<iostream>
- #include<vector>
- #include<algorithm>
- using namespace std;
- int main() {
- int t;
- cin >> t;
- for (int c = 1; c <= t; c++) {
- int D, N, K, S;
- cin >> D >> N;
- double maxHours = 0;
- for (int i = 0; i < N; i++) {
- cin >> K >> S;
- maxHours = max(maxHours, (double)(D - K) / S);
- }
- printf("Case #%d: %lf\n", c, D / maxHours);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement