P27378 [AtCoder] Three Cards
普及
题目描述

Problem Description

There are 3 cards. The first card has an integer \( A \), the second card has an integer \( B \), and the third card has an integer \( C \).

When choosing 2 cards from these 3 cards, output the minimum and maximum possible products of the integers written on the chosen 2 cards.

Input Format

The input is given from the standard input in the following format:

\( A \) \( B \) \( C \)

Output Format

Output the minimum value \( X \) and the maximum value \( Y \) of the product of the integers written on the chosen 2 cards, separated by a space, as follows:

\( X \) \( Y \)

Sample Input and Output

Sample Input #1

5 -2 4

Sample Output #1

-10 20

Sample Input #2

0 0 0

Sample Output #2

0 0

Notes/Hints

Constraints

  • \( -100 \leq A, B, C \leq 100 \)
  • \( A, B, C \) are integers

Sample Explanation 1

The products of the integers written on the chosen 2 cards are:
- When choosing the 1st and 2nd cards: \( 5 \times (-2) = -10 \)
- When choosing the 1st and 3rd cards: \( 5 \times 4 = 20 \)
- When choosing the 2nd and 3rd cards: \( (-2) \times 4 = -8 \)

Therefore, the minimum possible product is \( -10 \) and the maximum possible product is \( 20 \).

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5 -2 4
样例输出
-10 20