| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 256 MB | 374 | 306 | 282 | 85.976% |
There is no longer a STAAR test in physics—the pressure is off! You can just learn physics for the sheer fun of learning about the natural world (and to prepare for college)! To celebrate this fact, here’s a program on lenses.
Lenses use refraction of light to create magnified images. The distance to the object (p) and the distance to the image (q) are dependent on how “curved” the lens is, called the focal point (f). Using the following relationship:
1/f = 1/p + 1/q
For this program, given the object distance (p) and image distance (q), find the distance to the focus (f).
The first line consists of the number of data sets. Each data set is on one line and contains two integers (p and q).
For each data set, print out “f = ___” with the distance rounded to the nearest tenth.
3 5 6 5 5 10 15
f = 2.7 f = 2.5 f = 6.0