提示: 欢迎访问OurACM平台。
Problem 2016 How Long Is it

Accept: 166    Submit: 304
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

You are given two points in earth. (Points are described as the latitude (between -90 and +90 degrees) and longitude (between -180 and +180 degrees)) You are expected to calculate the distance between them ( in km). In this problem the radius of earth is 6378 km.

Input

In the first line one integer T indicates the number of test cases. (T <= 1000)

For each case, only two points each giving the latitude (between -90 and +90 degrees) and longitude (between -180 and +180 degrees) .

Output

For each test case, output the distance between them, the answer should accurate to 0.01.

Sample Input

4 -90 180 -90 90 -90 180 -90 90 -90 0 -90 90 -90 0 90 90

Sample Output

0.00 0.00 0.00 20037.08

Source

FOJ有奖月赛-2011年03月

Submit  Back  Status  Discuss