Subscribe For Free Updates!

We'll not spam mate! We promise.

Showing posts with label lightoj. Show all posts
Showing posts with label lightoj. Show all posts

Wednesday, December 11, 2013

Solve of lightoj problem no 1069 - Lift


import java.util.Scanner;
class Main {
    public static void main(String[] args){
    Scanner input = new Scanner(System.in);
    int a=input.nextInt();
    for(int i=1;i<=a;i++){
        int b,c,d,e,f;
         b=input.nextInt();
         c=input.nextInt();
        if(c>b)
        {
            d=((c-b)*4);
            e=(b*4);
            f=d+e+19;
        }
        else if(c<b)
        {

            d=((b-c)*4);
            e=(b*4);
            f=d+e+19;

        }
        else
        {
            d=(c*4);
           f=d+19;
        }
        System.out.println("Case "+i+": "+f);

       }

}
}




Sunday, December 8, 2013

Solve of lightoj problem no 1000 - Greetings from LightOJ


import java.util.Scanner;
class Main{

public static void main(String[] args)
{
    Scanner a = new Scanner(System.in);
    int b,i,c,d; b=a.nextInt();
    for( i=1;i<=b;i++)
    {
    c=a.nextInt();
    d=a.nextInt();
    System.out.println("Case "+i+": "+(c+d)); }
    }

}

Contact Form

Name

Email *

Message *