import java.util.Scanner;
class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int x = sc.nextInt();
if (x==0) break;
int y = sc.nextInt();
System.out.println(x + ((x-1)/(y-1)));
}
}
}
class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int x = sc.nextInt();
if (x==0) break;
int y = sc.nextInt();
System.out.println(x + ((x-1)/(y-1)));
}
}
}
No comments :
Post a Comment