Abby's Absolutes
면접 대비시간 제한1초메모리 제한2048 MB
각 요청 값에 대해 1까지의 거리와 N까지의 거리를 비교해 N에 더 가까우면 N을, 아니면 1을 출력한다. 거리가 같으면 1을 출력한다.
문제
Abby has offered to buy you some apples. However, she is very absolute about things.
You may ask her to buy a certain number of apples, but she may buy more apples if she figures that you want a lot of apples, or just buy one apple if she figures that you do not want very many apples. So, if the number of apples you want is closer to Abby's upper threshold than it is to , then she will buy a number of apples equal to her upper threshold. Otherwise, she will just buy one apple. If it is equally close to and her upper threshold, she will just buy apple.
You want to figure out the total number of apples Abby will buy for you after she takes one or more trips to the grocery store.
입력
The input will consist of two lines.
The first line will contain two space-separated integers. The first integer is the number of apples Abby will buy if she is buying a lot of apples. The second integer is the number of trips to the store Abby will take.
The second line will contain space-separated integers representing the number of apples you want to buy on each of Abby's trips to the store, with each of these integers being between and , inclusive.
출력
Output space-separated integers representing the number of apples Abby will buy for you for each of her trips to the store.