Question 1: focal length time limit: 256 ms single point time limit: Ms memory limit: MB
Description
In general, we use a pinhole camera model, that is, we think it uses the principle of small hole imaging.
In the camera coordinate system, in general, the unit length we use is not an international unit such as "meter", but the length of adjacent pixels. The focal length in the camera coordinate system is an important physical quantity in the field of image processing.
If we have obtained the physical focal length (focal length) of the lens, the width of the camera film (CCD width), and the image width ), the detailed formula is as follows:
Focal Length in pixels = (Image Width in pixels) * (focal length on earth)/(CCD width on earth)
For example, for Canon powershot 100
Focal Length in pixels = 1600 pixels * 5.4/5.27 = 1639.49 pixels
Now, please write a general program to solve the size of the focal length in the camera coordinate system.
Input
Multiple groups of trial data. The first is a positive integer T, indicating the number of groups of the trial data.
Each group of Token Test Data occupies one row, which is
Physical focal length of the lens (focal length on earth)
CCD width on earth)
The image width in pixels.
Are separated by a space.
Output
Each group of data outputs a row in the format of "case X: ypx ". X indicates the number of the trial data, starting from 1. y indicates the size of the focal length in the camera coordinate system (focallength in pixels). Valid digits after the decimal point are retained and rounded up.
Data range
For small data: Focal Length on Earth and CCD width on Earth are both in millimeters (mm)
For big data: the unit of length may also be meters (M), meters (DM), centimeters (CM), millimeters (mm), micron (UM), nano (Nm)
-
-
Example Input
-
-
25.4 5.27 0.00527 px5400um M 1600px
-
-
Example output
-
-
Case 1: 1639.47 pxcase 2: 1639.47px
The beauty of programming the first focal length of the preliminary round