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 Specifications

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

Output Specifications

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

There are no comments at the moment.