Dev.baelanche

[백준 2914] 저작권 본문

Data Structure & Algorithm/PS - JAVA

[백준 2914] 저작권

baelanche 2019. 4. 19. 21:34
반응형

 

문제에 기재되어 있는 (멜로디 개수 / 앨범 곡 개수) = 평균값(반올림) 을 거꾸로 해주면된다.

 

 

public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int a = sc.nextInt();
        int i = sc.nextInt();
        
        System.out.println((a * (i-1)) + 1); 
    }
}

 

머리 쉬려고 풀었다..ㅎㅎ

반응형

'Data Structure & Algorithm > PS - JAVA' 카테고리의 다른 글

[백준 2921] 도미노  (0) 2019.04.19
[백준 10569] 다면체  (0) 2019.04.19
[백준 1449] 수리공 항승  (0) 2019.04.19
[백준 4796] 캠핑  (0) 2019.04.19
[백준 16397] 탈출  (0) 2019.04.19
Comments