407199: GYM102697 170 Cooldown

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

170. Cooldowntime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
This problem is worth 35 points.

Every morning after you get out of bed, you brew yourself a nice cup of coffee to get yourself ready for the day. However, most of the time when you pick up the coffee to drink, it's too hot for you to drink! You know that Newton's Formula of Cooling is $$$T(t) = T_{s} + (T_{0} - T_{s})e^{-kt}$$$, where:

$$$T(t)$$$ is the temperature of the coffee at time $$$t$$$,

$$$T_{s}$$$ is the ambient temperature of the room,

$$$T_{0}$$$ is the initial temperature of the coffee, and

$$$k$$$ is the decay constant.

You also know that the coffee reaches your favorable heat from a initial temperature of 210 degrees to 120 degrees after 15 minutes of cooling, in a room temperature of 70 degrees.

Input

The first line of input will be an integer $$$n$$$, which denotes the amount of test cases to follow in the subsequent lines. The test cases will contain a positive integer $$$T(t)$$$, the temperature at time $$$t$$$.

Output

For each test case, output the time $$$t$$$ minutes it takes for the freshly brewed coffee to cool town to temperature $$$T(t)$$$.

ExampleInput
3
150
120
90
Output
8.152756910910513
15.000000000000002
28.348972201535375

加入题单

上一题 下一题 算法标签: