CCC '21 J1 - Boiling Water

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 3.0s
Memory limit: 512M

Problem type
Canadian Computing Competition: 2021 Stage 1, Junior #1

At sea level, atmospheric pressure is 100 kPa and water begins to boil at 100^{\circ}C. As you go above sea level, atmospheric pressure decreases, and water boils at lower temperatures. As you go below sea level, atmospheric pressure increases, and water boils at higher temperatures. A formula relating atmospheric pressure to the temperature at which water begins to boil is

\displaystyle P = 5 \times B - 400

where P is atmospheric pressure measured in kPa, and B is the temperature at which water begins to boil measured in ^{\circ}C.

Given the temperature at which water begins to boil, determine atmospheric pressure. Also determine if you are below sea level, at sea level, or above sea level.

Note that the science of this problem is generally correct but the values of 100^{\circ}C and 100 kPa are approximate and the formula is a simplification of the exact relationship between water's boiling point and atmospheric pressure.

Input Specification

The input is one line containing an integer B where B \ge 80 and B \le 200. This represents the temperature in ^{\circ}C at which water begins to boil.

Output Specification

The output is two lines. The first line must contain an integer which is atmospheric pressure measured in kPa. The second line must contain the integer -1, 0, or 1. This integer represents whether you are below sea level, at sea level, or above sea level, respectively.

Sample Input 1

99

Output for Sample Input 1

95
1

Explanation of Output for Sample Input 1

When B = 99, we can substitute into the formula and get P = 5 \times 99 - 400 which equals 95. Since 95 kPa is less than 100 kPa, you are above sea level.

Sample Input 2

102

Output for Sample Input 2

110
-1

Explanation of Output for Sample Input 2

When B = 102, we can substitute into the formula and get P = 5 \times 102 - 400 which equals 110. Since 110 kPa is greater than 100 kPa, you are below sea level.


Comments


  • -3
    QiQi  commented on Oct. 23, 2021, 12:03 a.m.

    (B - 100) X 5 (I'm pretty sure) works too.


  • -1
    2DragontamerJayden547422  commented on July 5, 2021, 10:38 p.m.

    This totally science and I USED to like science.


  • 3
    iiGam_r  commented on Feb. 28, 2021, 4:12 p.m.

    I hated this so much because I didn't read the text and what it said:

    "The second line must contain the integer -1, 0, or 1."

    REMEMBER TO PUT THE 0!!!


    • 2
      dchoo333  commented on Aug. 29, 2021, 2:22 a.m.

      I was confused and then I read your comment and I solved this. Thanks a lot.