Page 1 of 1

10598 - Find the Latitude

Posted: Thu Aug 19, 2004 7:04 pm
by Dreamer#1
hello ppl,

can someone please check whether the following input/outputs are ok or not... also, i cudn't figure out for wat input will there be less than 10 lines of output, can someone plz help me out... :)

regards

-Dreamer

Input:

8 1
110 11
5000 60
900 110
15000 250
0 0


Output:

Case 1:
81.69816
82.26810
82.45807
82.55306
82.61005
82.64805
82.67519
82.69554
82.71138
82.72404
Case 2:
83.35853
83.81448
83.96646
84.04245
84.08804
84.11844
84.14015
84.15644
84.16910
84.17923
Case 3:
89.20302
89.25774
89.27598
89.28509
89.29057
89.29421
89.29682
89.29877
89.30029
89.30151
Case 4:
81.88265
82.43992
82.62567
82.71855
82.77428
82.81143
82.83796
82.85787
82.87335
82.88573
Case 5:
88.89309
88.96908
88.99441
89.00707
89.01467
89.01974
89.02336
89.02607
89.02818
89.02987

Posted: Mon Aug 23, 2004 9:48 pm
by abishek
my AC program gives same output

Posted: Mon Aug 23, 2004 9:51 pm
by abishek
actually my program outputs 10 lines for everything

Posted: Thu Aug 11, 2005 10:23 am
by Dreamer#1
long ago i tried to solve this problem and got several WA and now again when i'm trying fresh its all the same.. WA :(

so i'm posting my code and hope someone will point out a test case that it fails...

Code: Select all


#include <stdio.h>
#include <math.h>

const long double pi=3.1415926535897932384626433832795 ;//acos(-1);

int main()
{
	long double r,n,v;
	int k,tc=1;

	while(1)
	{
		scanf("%Lf%Lf",&r,&n);
		if(r+n==0.0) break;

		printf("Case %d:\n",tc++);
		for(k=2;k<=20;k+=2)
		{
			v= pi/2 - ( n+ n/pi/k )/r; 
			printf("%.5Lf\n", v*180/pi );
		}
	}

	return 0;
}
thanks in advance.

Posted: Wed Jan 04, 2006 1:07 am
by daveon
Hi,

input:

Code: Select all

99999 12000
0 0
output:

Code: Select all

Case 1:
82.03009
82.57729
82.75968
82.85087
82.90558
82.94206
82.96811
82.98765
83.00285
83.01501