← All problemsSign in

Chef and His Friend

CodeChefRating 1988Open on judge ↗

Chef and his friend Yurii decided to meet in the cafe. As they are very busy one would not wait for another too long. Namely, after arriving, Chef will spend at most t1 seconds waiting for Yurii while Yurii will wait no more than t2 seconds. Chef can arrive at any moment within [0..T1] with equal probability. Similarly Yurii can arrive at any moment within [0..T2]. Arrival time may be any real n

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start