Saturday 26 March 2016

Solution of LIGHT OJ 1072 :: Calm Down


Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.

/**Bismillahir Rahmanir Rahim.**/

#include <stdio.h>
#include <math.h>
#define PI acos(0.0)*2
int main()
{
    int x,y,z;
    double a,b,c,d,f,g,h;
    double e;
    scanf("%d", &x);
    for(y=1; y<=x; y++){
        scanf("%lf%lf", &a, &b);
        c=(PI/b);
        d=sin(c);
        e=(a*d)/(1+d);
        z=(int) e;
        h=(e*1.0)/z;
        if(h!=1)
           printf("Case %d: %.10lf\n",y, e);
        else
           printf("Case %d: %.0lf\n",y, e);
    }
    return 0;
}

4 comments:

  1. sin ken use korsi vai,buji nah to!!!!!!!!!!!!!!

    ReplyDelete
  2. bai,solution ta bujlam na kivabe holo?????????????????????????????????

    ReplyDelete
  3. bai,solution ta bujlam na kivabe holo?????????????????????????????????

    ReplyDelete
  4. See this, Mijanur Rahman

    http://light-online-judge.blogspot.com/2012/05/lightoj-1072-calm-down.html

    ReplyDelete

Note: only a member of this blog may post a comment.