본문 바로가기
Computer Science

기차 사이의 파리

by OKOK 2019. 1. 30.

1. 오케이

2. 기차 사이의 파리

3. 수학적으로 풀이 가능 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
 
int main()
{
    freopen("input.txt""r", stdin);
    int test_case;
    int T;
    scanf("%d"&T);
    for (test_case = 1; test_case <= T; ++test_case)
    {
        int d, a, b, f;
        scanf("%d %d %d %d"&d, &a, &b, &f);
        double ans = (double)(d*f) / (double)(a + b);
        printf("#%d %lf\n", test_case, ans);
    }
    return 0;
}
cs

 


'Computer Science' 카테고리의 다른 글

정곤이의 단조 증가하는 수  (0) 2019.01.31
삼성시의 버스 노선  (0) 2019.01.31
금속막대  (0) 2019.01.28
행렬찾기  (0) 2019.01.28
K번째 문자열  (0) 2019.01.28

댓글