View Code of Problem 70

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner in =new Scanner(System.in);
		int x=in.nextInt();
		int  d;
		if(x<=100000)d= x/10;
		else if(x<=200000)d=(x-100000)*75/1000+10000;
		else if(x<=400000)d=(x-200000)*5/100+17500;
		else if(x<=600000)d=(x-400000)*3/100+27500;
		else if(x<=1000000)d=(x-600000)*15/1000+33500;
		else d=(x-1000000)/100+39500;
		
		System.out.println(d);
	}

}

Double click to view unformatted code.


Back to problem 70