알고리즘왕 45

[백준/1712/JAVA] 손익분기점

import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int result = 0; if(b>=c) result = -1; else result = a/(c-b) + 1; System.out.println(result); } } 제목 보고 1차 당황 내용 자체는 쉬워서 안심했다가 4번 틀려서 2차 당황 ㅠㅠ;;;;;;;;;;;;;;;;;;; a+b*x < c*x인 경우에 x를 출력하도록 했었는데 외,, 툴렷을까,,,? 구글링 해서 겨우..

알고리즘왕/BOJ 2020.03.18