[Solution] Mean and Median CodeChef Solution
Problem
Chef has two numbers and . Chef wants to find three integers and such that:
Can you help Chef find such three integers?
As a reminder, and is the element at the (middle) position after we sort in non-decreasing order.
Input Format
- The first line contains a single integer — the number of test cases. Then the test cases follow.
- The first and only line of each test case contains two space-separated integers and — the required mean and median of the three integers.
Output Format
For each test case, output three integers which satisfy the given conditions.
👇👇👇👇👇
It is guaranteed that an answer always exists under the given constraints.
If multiple answers exist, output any.
Explanation:
Test Case 1: , .
Test Case 2: , .
Test Case 3: , .
No comments:
Post a Comment