what to understand from this statement :-" K can be written in the form of p/q where gcd (p,q)=1 " ?
lets suppose that K=100 that how to express 100 in form of p/q where gcd(p,q) =1 ???
what to understand from this statement :-" K can be written in the form of p/q where gcd (p,q)=1 " ?
lets suppose that K=100 that how to express 100 in form of p/q where gcd(p,q) =1 ???
If p=100 and q=1…honestly if p=K and q=1 then it’s always possible…
no i have tried the same way but answer is wrong
prob link :- PCJ18C Problem - CodeChef
sol link :- CodeChef: Practical coding for everyone
Your cd can be fraction also
p and q are co-prime
It can be done like this…
The sum of internal angles of a polygon is 180*(n-2).
Take an example of a quadrilateral with A=55.
The remaining angles will be 55+d, 55+2d and 55+3d, since the question says they are in AP.
Then, 55+55+d+55+2d+55+3d=360 [180*(4-2)]
or, 6d+220=360
or, d=140/6 = 70/3
So, the other angles are 235/3, 305/3 and 125
So, if it asks for 2nd angle, output it as 235 3
If asked for 4th angle, output as 125 1
That’s what I think it should work…