Mock CCC '20 Contest 1 J1 - A Rage Tree Problem

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

koosaga has been training hard for programming contests! One day, he decides to pick up a new data structure, the rage tree.

The rage tree efficiently supports operations on collections of integers - for example, it can be used to quickly find the minimum integer among a collection of integers or the maximum integer among a collection of integers.

To ensure that he properly understands the mechanics of the rage tree data structure, he will use one to solve the following problem:

Given four integers, find the smallest integer among those four as well as the largest integer.

koosaga would like to verify the correctness of his implementation, and asks you to also compute these integers.

Subtasks

In tests worth 5 marks, all four integers will be equal.

In tests worth another 5 marks, all four integers will be presented in nondecreasing order.

Input Specification

The input will consist of four lines. Each line will contain a single positive integer between 1 and 100.

Output Specification

Output two lines. On the first line, output the smallest integer. On the second line, output the largest integer.

Sample Input 1

1
1
1
1

Sample Output 1

1
1

Sample Input 2

1
2
3
4

Sample Output 2

1
4

Comments


  • 1
    B0T  commented on Aug. 21, 2024, 6:38 p.m.

    I think the reason why it's called "rage tree" is because it makes me rage.


  • 0
    kittycornanna1  commented on April 4, 2024, 8:32 p.m.

    Why are there so many cases.