Pages

Thursday 4 October 2012

UVA - 10499 - The Land of Justice


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws IOException {

        Scanner s=new Scanner(System.in);
        StringBuilder sb = new StringBuilder("");
        while (true) {
            long temp=s.nextLong();
            if(temp<0)
                break;
            BigInteger bg=BigInteger.valueOf(temp);
            if (bg == BigInteger.ONE) {
                sb.append("0%\n");
            } else {
                sb.append(bg.multiply(BigInteger.valueOf(25))).append("%\n");
            }
        }
        System.out.print(sb);
    }
}

No comments:

Post a Comment