Advertisement
erfanul007

Light OJ 1072

Dec 30th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5. int t,i,c;
  6. double R,n,x,r,pi;
  7. pi=2*acos(0.0);
  8. scanf("%d",&t);
  9. for(i=1;i<=t;i++){
  10. scanf("%lf %lf",&R,&n);
  11. x=sin(pi/n);
  12. r=(R*x)/(1+x);
  13. c=ceil(r);
  14. if(r==c)
  15. printf("Case %d: %d\n",i,c);
  16. else
  17. printf("Case %d: %lf\n",i,r);
  18. }
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement