RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
ICPC00049

G. Pipe Stream

Unrated 레이팅 미적용
난이도
2s
시간 제한
1024MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Your hometown has hired some contractors – including you! – to m\(an- ag\)e its municipal pipe network. They built the network, at great \(ex- pe\)nse, to supply Flubber to every home in town. Unfortunately, \(no- bo\)dy has found a use for Flubber yet, but never mind. It was a Flubber network or a fire department, and honestly, houses burn down so rarely, a fire department hardly seems necessary. In the possible event that somebody somewhere decides they want some Flubber, they would like to know how quickly it will flow through the pipes. Measuring its rate of flow is your job. You have access to one of the pipes connected to the network. The pipe is \(l\) meters long, and you can start the flow of Flubber through this pipe at a time of your choosing. You know that it flows with a constant re\(al-va\)lued speed, which is at least \(v_{1}\) mete\(rs/se\)cond and at most \(v_{2}\) mete\(rs/se\)cond. You want to estimate this speed with an absolute error of at most ^{t} 2 ^{mete\(rs/se\)cond.} Unfortunately, the pipe is opaque, so the only thing you can do is to knock on the pipe at any point along its length, that is, in the closed re\(al-va\)lued range [0, l]. Listening to the sound of the knock will tell you whether or not the Flubber has reached that point. You are not infinitely fast. Your first knock must be at least \(s\) seconds after starting the flow, and there must be at least \(s\) seconds between knocks. Determine a strategy that will require the fewest knocks, in the worst case, to estimate how fast the Flubber is flowing. Note that in some cases the desired estimation might be impossible (for example, if the Flubber reaches the end of the pipe too quickly).

제약
입력 형식

The input consists of multiple test cases. The first line of input contains an integer \(c\) (\(1 \le c \le 100\)), the number of test cases. Each of the next \(c\) lines describes one test case. Each test case contains the five integers \(l\), \(v\)1, \(v\)2, \(t\) and \(s\) (\(1 \le l\), v1, v2, t, \(s \le 10^{9}\) and \(v1 < v\)2), which are described above.

출력 형식

For each test case, display the minimal number of knocks required to estimate the flow speed in the worst case. If it might be impossible to measure the flow speed accurately enough, display impossible instead.

예제 1
입력
3
1000 1 30 1 1
60 2 10 2 5
59 2 10 2 5
출력
5
3
impossible
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC World Finals 2015

평가 및 의견

G. Pipe Stream

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

G. Pipe Stream

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8