#P9955. [USACO20DEC] Do You Know Your ABCs? B

[USACO20DEC] Do You Know Your ABCs? B

Problem Description

Farmer John’s cows are holding their daily meeting on the "mooZ" video conferencing platform. They invented a simple number game to make the meeting more fun.

Elsie has three positive integers AA, BB, and CC (A≤B≤CA\le B\le C). These numbers are secret, and she will not tell them directly to her sister Bessie. She tells Bessie seven integers in the range 1…1091\ldots 10^9 (not necessarily distinct), claiming that they are some permutation of AA, BB, CC, A+BA+B, B+CB+C, C+AC+A, and A+B+CA+B+C.

Given these seven integers, help Bessie find AA, BB, and CC. It can be proven that the answer is unique.

Input Format

Input one line containing seven space-separated integers.

Output Format

Output AA, BB, and CC, separated by spaces.

2 2 11 4 9 7 9
2 2 7

Hint

Subtask Properties

  • Subtasks 2−32-3 satisfy C≤50C\le 50.
  • Subtasks 4−104-10 have no additional constraints.

Translated by ChatGPT 5