본문 바로가기
Beakjoon&프로그래머스/Java

[백준/Java] 8437번 Julka

by 현장 2022. 4. 11.

-Code

import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		BigInteger totalApple = sc.nextBigInteger();
		BigInteger gap = sc.nextBigInteger();
		BigInteger two = new BigInteger("2");
		
		BigInteger avg = totalApple.subtract(gap).divide(two);
		System.out.println(avg.add(gap));
		System.out.println(avg);
 	}	
}