package test.demo; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Yukicoder63 { public static void main(String[] args) throws IOException { // TODO 自動生成されたメソッド・スタブ String[]str=input(); int L=Integer.parseInt(str[0]); int K=Integer.parseInt(str[1]); int count=0; while(true) { L=L-2*K; if(L<=0) { System.out.println(count); return; } count+=K; } } public static String[] input() throws IOException { BufferedReader br =new BufferedReader(new InputStreamReader(System.in)); String str=br.readLine(); String[]str2=str.split(" "); return str2; } }