10598 - Find the Latitude

All about problems in Volume 105. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Dreamer#1
Learning poster
Posts: 77
Joined: Tue Oct 07, 2003 10:07 pm

10598 - Find the Latitude

Post 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
Not all of our dreams can be made to come true. But still we live with the hope to turn them into reality someday.

abishek
Experienced poster
Posts: 131
Joined: Mon Dec 15, 2003 5:41 am

Post by abishek »

my AC program gives same output

abishek
Experienced poster
Posts: 131
Joined: Mon Dec 15, 2003 5:41 am

Post by abishek »

actually my program outputs 10 lines for everything

Dreamer#1
Learning poster
Posts: 77
Joined: Tue Oct 07, 2003 10:07 pm

Post 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.

daveon
Experienced poster
Posts: 229
Joined: Tue Aug 31, 2004 2:41 am
Location: TORONTO, CANADA

Post 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

Post Reply

Return to “Volume 105 (10500-10599)”