{"problem":{"name":"022. Detector Building","description":{"content":"Uh oh! You are working on building an analog thermometer using nonlinear components, so how can you calibrate your temperature sensor with test data? You can use a form of nonlinear regression in the ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269022"},"statements":[{"statement_type":"Markdown","content":"Uh oh! You are working on building an analog thermometer using nonlinear components, so how can you calibrate your temperature sensor with test data? You can use a form of nonlinear regression in the form of the Steinhart-Hart equation, an equation designed to explain the relation between the electrical resistance of a solid and its temperature. While this task may sound difficult, it is actually quite simple using the equation. The Steinhart-Hart equation itself has three calculated constants(A,B, and C), and takes in a value R, which is the resistance of the metal.\n\nThe equation is represented as:\n\n$frac(1, T) = A + B (l n R) + C (l n R)^3$\n\nThis equation is useful for the process of actual temperature determination, but we still need to calculate the constants A, B, and C before we can use it. To find these values, we must first find three resistance to temperature data points, which are usually discovered through experimentation. For this problem, these data points will be provided and you will be required to find the A, B, and C constants. The process of finding these values involves calculating a series of equations. These equations are as follows:\n\n$L_1 = l n R_1$\n\n$L_2 = l n R_2$\n\n$L_3 = l n R_3$\n\n$Y_1 = frac(1, T_1)$\n\n$Y_2 = frac(1, T_2)$\n\n$Y_3 = frac(1, T_3)$\n\n$gamma_2 = (Y_2 -Y_1) \\/ (L_2 -L_1)$\n\n$gamma_3 = (Y_3 -Y_1) \\/ (L_3 -L_1)$\n\n$C = ((gamma_3 -gamma_2) \\/ (L_3 -L_2)) * (L 1 + L 2 + L 3)^(-1)$\n\n$B = gamma_2 -C (L_1^2 + L_1 L_2 + L_2^2)$\n\n$A = Y_1 -L_1 (B + L_1^2 C)$\n\nFor this problem, you will be given R1, R2, R3, T1, T2, and T3. You are tasked with then calculating the value for A, you will not have to return B and C considering that a valid number for A will imply correct values for B and C.\n\nThe double values T1, T2, T3, R1, R2, and R3 will be each provided sequentially on a separate line.\n\nA double representing the value of A\n\nDo not worry about precision or rounding, as there is some tolerance in the solution checking. Also, remember that you can calculate the natural log of a number using math.log in Python or Math.log in Java. In addition, some of the provided equations require variables from previous equations, so you will need to solve them in order.\n\n## Input\n\nThe double values T1, T2, T3, R1, R2, and R3 will be each provided sequentially on a separate line.\n\n## Output\n\nA double representing the value of A\n\n[samples]\n\n## Note\n\nDo not worry about precision or rounding, as there is some tolerance in the solution checking. Also, remember that you can calculate the natural log of a number using math.log in Python or Math.log in Java. In addition, some of the provided equations require variables from previous equations, so you will need to solve them in order.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ R_1, R_2, R_3 \\in \\mathbb{R}^+ $ be the resistance measurements.  \nLet $ T_1, T_2, T_3 \\in \\mathbb{R}^+ $ be the corresponding temperature measurements (in Kelvin).  \n\nDefine:  \n- $ L_i = \\ln R_i $ for $ i \\in \\{1, 2, 3\\} $  \n- $ Y_i = \\frac{1}{T_i} $ for $ i \\in \\{1, 2, 3\\} $  \n\n**Constraints**  \nAll values $ R_i > 0 $, $ T_i > 0 $, and $ L_i \\neq L_j $ for $ i \\neq j $.  \n\n**Objective**  \nCompute the constant $ A $ using:  \n$$\n\\gamma_2 = \\frac{Y_2 - Y_1}{L_2 - L_1}, \\quad\n\\gamma_3 = \\frac{Y_3 - Y_1}{L_3 - L_1}\n$$  \n$$\nC = \\left( \\frac{\\gamma_3 - \\gamma_2}{L_3 - L_2} \\right) \\cdot (L_1 + L_2 + L_3)^{-1}\n$$  \n$$\nB = \\gamma_2 - C (L_1^2 + L_1 L_2 + L_2^2)\n$$  \n$$\nA = Y_1 - L_1 (B + L_1^2 C)\n$$  \n\nOutput $ A $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269022","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}