Hide

Problem C
Scaling Recipe

You’ve got a recipe which specifies a number of ingredients, the amount of each ingredient you will need, and the number of portions it produces. But, the number of portions you need is not the same as the number of portions specified in the recipe! How can you scale it?

Input

The first line of input contains three integers $n$ ($1 \le n \le 40$), $x$ and $y$ ($1 \le x,y \le 40{,}000$), where $n$ is the number of ingredients in the recipe, $x$ is the number of portions that the recipe produces, and $y$ is the number of portions you need.

Each of the next $n$ lines contains a single integer $a$ ($1 \le a \le 40{,}000$). These are the amounts of each ingredient needed for the recipe.

The inputs will be chosen so that the amount of each ingredient needed for $y$ portions will be an integer.

Output

Output $n$ lines. On each line output a single integer, which is the amount of that ingredient needed to produce $y$ portions of the recipe. Output these values in the order of the input.

Sample Input 1 Sample Output 1
2 4 10
8
12
20
30
Sample Input 2 Sample Output 2
3 37627 38021
34571
38009
34189
34933
38407
34547

Please log in to submit a solution to this problem

Log in