ACM (TJU) : 1015


// http://acm.tju.edu.cn/toj/showp1015.html
#include <stdio.h>

int main ()
{
    int scenarios;
    scanf ("%d", &scenarios);

    int cases = 0;

    while ( scenarios-- ) {
        int m, n;

        scanf ("%d %d", &m, &n);

        printf ("Scenario #%d:\n", ++cases);

        if ( m % 2 && n % 2 )
            printf ("%.2lf\n\n", m * n + 0.4142);

        else
            printf ("%.2lf\n\n", (double) m * n);
    }

    return 0;
}
Advertisements

One thought on “ACM (TJU) : 1015

  1. /*
    Author : Saidul Islam
    Dept : CSE
    United International University
    Runing time : 00.00.00 ms
    */
    #include <stdio.h>
    
    int main()
    {
        int testCase,m,n,scene=1;
    
        scanf("%d",&testCase);
    
        while(testCase--)
        {
            scanf("%d %d",&m,&n);
    
            if(m&1 && n&1)
                printf("Scenario #%d:\n%d.41\n\n",
                scene++,m*n);
            else
                printf("Scenario #%d:\n%d.00\n\n",
                scene++,m*n);
        }
        return 0;
    }
    

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s