A Pizza Slice

Pages: 12
As the contest is over now, can someone explain the logic of the pizza question?
base angle (i.e.A1A0B1 = pi/(2*n+1)
now by using this angle, and properties of isosceles triangle and exterior angle property we can get any angle
why is A1A0B1 = pi/2*n+1
@honeybuzz draw figures for n=1,2,3. Apply proprties of triangles, u will get it. If u dont DM me.
@honey buzz as blackmamba told draw the figures and apply geometry u should get it.
I will post the code if anyone wants to rectify(those who have solved will understand)
#include<bits/stdc++.h>
using namespace std;
void frac(long frac1,long frac2){
long a = frac1;
long b = frac2;
//Calculate GCD
long c = a % b;

while(c > 0)
{
a = b;
b = c;
c = a % b;
}

long gcd = b;

frac1 /= gcd;
frac2 /= gcd;
cout<<frac1<<" "<<frac2<<endl;

}


int main(){
int q;
long n,t,x,y,z;
cin>>q;
while(q--){
cin>>n>>t>>x>>y>>z;
if(t==3){
if(x<y&&y<z){
frac(2*n+1-x,2*n+1);
}
else if(x>y&&y>z){
frac(2*n+1-x,2*n+1);
}
else if(x>y&&y<z){
frac(x,2*n+1);
}
else if(x<y&&z<y){
frac(x,2*n+1);
}
}
else if(t==2){
if(x<y&&y<z){
frac(2*n-2*y+1,2*n+1);
}
else if(x>y&&y>z){
frac(2*n-2*y+1,2*n+1);
}
}
else if(t==1){
if(x<y&&y<z){
frac(2*n+1-z,2*n+1);
}
else if(x>y&&y>z){
frac(2*n+1-z,2*n+1);
}
else if(x>y&&y<z){
frac(x,2*n+1);
}
else if(x<y&&z<y){
frac(x,2*n+1);
}
}
else if(t==4){
if(x<y&&y<z){
frac(2*n-2*y+1,2*n+1);
}
else if(x>y&&y>z){
frac(2*n-2*y+1,2*n+1);
}

}
}
}
logic for challange problem anyone?
i got 43.5 points.
here is my logic.
I used spiral propagation and paired the points which came in the way!!
Can anyone share logic who got more points.
Which question are u talking about ? No offence though
MATCHIT
No I didn't try that also :(
It would be great if someone gives hints for EARTSEQ
Topic archived. No new replies allowed.
Pages: 12