HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


050. 50510 - What floor are they?

Guest
• Review clarifications (1)

Volume problems

• 004. 50433 - Sum of Cubes
• 005. 50595 - Sum of the numbers
• 010. 50582 - Number of digits
• 016. 50459 - The Biggest Digit
• 020. 50575 - Number of Prime num...
• 030. 50576 - Number of Perfect nu...
• 035. 50467 - Random Numbers
• 040. 50354 - Intersecting Rectangles
• 050. 50510 - What floor are they?
• 050. 50566 - Grade Point Average (...
• 060. 50727 - Fibonacci Numbers
• 061. 50733 - The Highest Average
• 062. 50390 - Total Salary Paid
• 066. 50523 - Total Tax to Pay
• 070. 50534 - Top Trading Company
• 076. 50289 - Monthly Allowance
• 080. 50347 - Selling Oranges

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

What floor are they?

Mr. Arbi Cela works in National Post Services (NPS). He distributes mails to the people. Sometimes he goes to apartments buildings and has to find out the floor number from the apartment number. In some buildings, first several floors are reserved for the shops. In some other buildings, apartment numbers start from a basement floor. And thus, the apartment numbers start from different floors.

Write a program that will find out the floor number from the given data.

Input specification
In the beginning, you will be given 3 integers

  • n: the number of apartments in this building
  • m: the number of apartments in every floor
  • k: starting floor number for the apartments
where 0 ≤ n ≤ 50, 1 ≤ m ≤ 10, -3 ≤ k ≤ 5. Then, you will be given n space separated apartment numbers in the following line which are between 1 and 1000.

Output specification
Show n space-separated integers: the floor numbers for every apartment given.

Sample Input I
4 6 3
32 3 22 17
Sample Output I
8 3 6 5

Explanation: For the apartment number: 22

  • there are 6 apartments in every floor
  • The apartment numbers start from the third floor

There are 6 apartments in the third floor, 6 in the fourth floor and 6 floor in the fifth floor which makes 18 apartments. Then, the other 4 is in the sixth floor.



Для отправки решений необходимо выполнить вход.

www.contester.ru