Three pillarsTime
limit:2000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total Submission (s): 2406 Accepted Submission (s): 1335
Problem Descriptionmca mountain talents, insight outside the war, the mountains of the hero decided to rescue the people in the mountain, the fire and fire, had to sweep the whole field of whisky, before the high number of 99 of extraterrestrial visitors. Has been a sword cast ten years of the same, blood oath, entrenched in the national fortress (abbreviation for the National race) encounter enemy kill, the Buddha killed Buddha, eventually repel the Liao Army. Temporary pacification foreign aggression, three positions also in the steady state.
Unfortunately, Liao oath not reconciled, Liao State Levy South General < Law Javac++> to find out three people where one break, now he found the position of whisky S, extraterrestrial location u, just very difficult to detect also the whereabouts of the Philippine V, just can know three people to meet the relationship:
arctan (1/s) = arctan (1/u) +arctan (1/v)
Note: (Middle 0 <= x <= 1)
Define f (S, u, v) = v*u-s*u-s*v value of < three pillars >
< law javac++> want to calculate < three pillars > values
Input first enters a T, which indicates that there is a T group of data, followed by the T line:
Input s, u (s <= 12^3, U <= 2^20 and S, u, v > 0)
And the s,u,v are real numbers.
Output v*u-s*u-s*v value for simplicity, assuming decimal, direct rounding
For example: The answer is 1.7 output 1
Sample Input
11 2
Sample Output
1
Where's author heroes coming out?
Source
Field=problem&key=2008%a1%b0%e7%cd%b7%d7%cf%c2%c9%b3%d0%a3%d4%b0%ce%c4%bb%af%bb%ee%b6%af%d4%c2%a1%b1%d6%ae %b4%f3%d1%a7%c9%fa%b3%cc%d0%f2%c9%e8%bc%c6%be%ba%c8%fc%f4%df%d0%c2%c9%fa%d7%a8%b3%a1&source=1& Searchmode=source ">2008" Fun Xia Sha Campus cultural activity Month "College student Program design contest and freshman session borrowed from the discussion area Daniel's derivation process:
1.tan (a+b) = (Tan (a) + tan (b))/(1–tan (a) * TAN (b)) 2.tan (Atan (x)) = Xarctan (1/s) = arctan (1/u) +arctan (1/v) So 1/s = Tan (arctan (1/u) +arctan (1/v)) = (Tan (arctan (1/u)) + tan (arctan (1/v)))/(1-tan (arctan (1/u)) *tan (arctan (1/v))) = (1/u + 1/ V)/(1-1/(UV)) so the solution is UV = 1 + us + vs so v*u-s*u-s*v constant equals 1
#include <stdio.h>int main () {int t;scanf ("%d", &t), while (t--) {scanf ("%*d%*d");p rintf ("1\n");} return 0;}
HDU2552 three pillars "mathematical reasoning"