Saturday, October 17, 2015

할부

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.*;

public class Main {

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  
  Scanner sc = new Scanner(System.in);
  
  int N = sc.nextInt();
  int B = sc.nextInt();
  
  int Quotient = B / (N-1);
  
  int min = 0;
  int max = 0;
  
  if(B % (N-1) == 0){
   min = Quotient-1+B;
   max = Quotient+B;
  }else{
   min = Quotient+B;
   max = Quotient+B;
  }
  

  System.out.println(min+" "+max);
  
 }

}

No comments:

Post a Comment