#abc330b. B - Minimize Abs 1
B - Minimize Abs 1
Score : points
问题描述
你给定一个整数序列 ,其长度为 ,以及满足 的整数 和 。
对于每个 ,找出满足以下两个条件的整数 。请注意,要找到的整数总是唯一确定的。
- 。
- 对于所有满足 的整数 ,都有 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given an integer sequence of length and integers and such that .
For each , find the integer that satisfies both of the following conditions. Note that the integer to be found is always uniquely determined.
- .
- For every integer such that , it holds that .
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print for , separated by spaces.
Sample Input 1
5 4 7
3 1 4 9 7
Sample Output 1
4 4 4 7 7
For :
Thus, .
Sample Input 2
3 10 10
11 10 9
Sample Output 2
10 10 10
update @ 2024/3/10 01:13:36