#P15085. [UOI 2025 II Stage] Family

[UOI 2025 II Stage] Family

题目描述

The friends of Vus the Cossack: Fedir and Ksenia --- twins in a large family.

One day, during a lunch break, Vus asked the twins to tell something about their family. Fedir said that he has b1b_1 brothers and s1s_1 sisters, while Ksenia has b2b_2 brothers and s2s_2 sisters.

Vus the Cossack remembered these four numbers, but he forgot who among the twins answered first.

That is, remembering that four numbers b1,s1,b2,s2b_1,s_1,b_2,s_2 were mentioned, he is not sure whether b1,s1b_1,s_1 is Fedir's answer or Ksenia's. However, he is sure that b1b_1 and b2b_2 denote brothers, while s1s_1 and s2s_2 denote sisters.

Vus became curious about how many brothers and sisters there are in their family in total, so with these four numbers, he turned to you for help.

输入格式

The first line contains four integers b1b_1, s1s_1, b2b_2, and s2s_2 (0bi,si200 \leq b_i,s_i\leq 20; b1b2=1|b_1 - b_2| = 1; s1s2=1|s_1 - s_2|=1) --- the responses of the twins.

It is guaranteed that a solution exists.

输出格式

In a single line, output two integers --- the number of brothers and sisters in the family, respectively.

1 5 2 4
2 5
10 6 9 7
10 7