This page is still under construction.

Parts of this page are still being built. What you see may change.

Pie Chart

Interview

Time limit2sMemory limit256 MB

Summary
Given n numbers and a radius r, split the circle's area into sectors proportional to each number and print every sector's area.
Level

Easy2 of 10

Topics
Math, Implementation, Array
Solved
No attempts yet

Problem

Graphs and charts of various kinds are used in many fields to depict the ratios between quantities of different sorts. One type of chart is the pie chart.

The input for a pie chart is a set of numbers a1,…,ana_1, \ldots, a_n, and the chart is a circle of radius rr divided into sectors. Each number corresponds to exactly one sector, whose area is proportional to that number. The total area of the sectors equals the area of the circle.

Given a set of numbers and the radius of the circle, determine the area of each sector of the pie chart.

Input

The first line contains two integers nn and rr (1≤n,r≤1001 \le n, r \le 100). The second line contains nn integers a1,…,ana_1, \ldots, a_n (1≤ai≤1001 \le a_i \le 100 for all ii from 11 to nn).

Output

Print nn real numbers, the areas of the sectors corresponding to the numbers a1,…,ana_1, \ldots, a_n. Print each number on a separate line. All of these numbers must be printed with precision no worse than 10−610^{-6}.

Examples1

  1. Example 1

    Input
    3 2
    1 4 3
    
    Expected output
    1.570796327
    6.283185307
    4.712388980