#P6488. [COCI 2010/2011 #6] OKUPLJANJE

[COCI 2010/2011 #6] OKUPLJANJE

Description

After a huge party ends, five newspapers publish the number of people who attended the party, but the numbers in these newspapers may be wrong.

Now you know that the total area of the venue is LL square meters, and on average there are pp people per square meter. Please compute, for each of the five newspapers, the difference between the published number of attendees and the actual number of attendees.

Input Format

The first line contains two integers, representing the venue area LL and the average number of people per square meter pp.

The second line contains five integers a1a5a_1 \dots a_5, representing the numbers published by the five newspapers.

Output Format

Output one line with five integers, in order, representing the difference between each newspaper’s published number and the actual number.

1 10
10 10 10 10 10

0 0 0 0 0

5 20
99 101 1000 0 97

-1 1 900 -100 -3

Hint

Constraints

For all test cases, it is guaranteed that 1L,p1091 \leq L, p \leq 10^9 and 0ai10180 \leq a_i \leq 10^{18}.

Notes

This problem is translated from COCI2010-2011 CONTEST #6 T1 OKUPLJANJE. Translation by @一扶苏一, with Constraints slightly modified.

Translated by ChatGPT 5