스크린샷 2023-03-16 171258.png

링크


1712번: 손익분기점

문제설명


Untitled

문제 풀이


import java.util.Scanner;

public class p1712 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        if (b >= c) {
            System.out.println("-1");
        } else {
            System.out.println(a / (c - b) + 1);
        }

    }
}

a : 고정 비용, b : 가변 비용, c : 노트북 가격

손익분기점 = 총 수입(판매비용) > 총 비용(=고정비용+가변비용)

수식화