Problem C

Statement
Copy Copied
Description:
Once Petya was in such a good mood that he decided to help his mum with the washing-up. There were n dirty bowls in the sink. From the geometrical point of view each bowl looks like a blunted cone. We can disregard the width of the walls and bottom. Petya puts the clean bowls one on another naturally, i. e. so that their vertical axes coincide (see the picture). You will be given the order in which Petya washes the bowls. Determine the height of the construction, i.e. the distance from the bottom of the lowest bowl to the top of the highest one.

Input Format:
The first input line contains integer n (1 ≤ n ≤ 3000). Each of the following n lines contains 3 integers h, r and R (1 ≤ h ≤ 10000, 1 ≤ r < R ≤ 10000). They are the height of a bowl, the radius of its bottom and the radius of its top. The plates are given in the order Petya puts them on the table.

Output Format:
Output the height of the plate pile accurate to at least 10 - 6.

Note:
None

Submissions

IDLanguageExit CodeTimestampCodeStdoutStderrRetry
5442 cpp 0 2026-03-14T06:08:52.535884Z View View View Retry
5435 cpp 1 2026-03-14T05:59:53.383284Z View View View Retry
5252 go 1 2026-03-13T05:44:38.313993Z View View View Retry

Evaluations

Eval IDRun IDProviderModelLangSuccessTimestampPromptResponseStdoutStderrRetry
2301 20260312-030039 openai gpt-5.4 go false 2026-03-12T04:57:24.264353Z View View View View Retry