CF794B.Cutting Carrot

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Igor the analyst has adopted nn little bunnies. As we all know, bunnies love carrots. Thus, Igor has bought a carrot to be shared between his bunnies. Igor wants to treat all the bunnies equally, and thus he wants to cut the carrot into nn pieces of equal area.

Formally, the carrot can be viewed as an isosceles triangle with base length equal to 11 and height equal to hh . Igor wants to make n1n-1 cuts parallel to the base to cut the carrot into nn pieces. He wants to make sure that all nn pieces have the same area. Can you help Igor determine where to cut the carrot so that each piece have equal area?

Illustration to the first example.

输入格式

The first and only line of input contains two space-separated integers, nn and hh ( 2<=n<=10002<=n<=1000 , 1<=h<=1051<=h<=10^{5} ).

输出格式

The output should contain n1n-1 real numbers x1,x2,...,xn1x_{1},x_{2},...,x_{n-1} . The number xix_{i} denotes that the ii -th cut must be made xix_{i} units away from the apex of the carrot. In addition, 0<x_{1}<x_{2}<...<x_{n-1}<h must hold.

Your output will be considered correct if absolute or relative error of every number in your output doesn't exceed 10610^{-6} .

Formally, let your answer be aa , and the jury's answer be bb . Your answer is considered correct if .

输入输出样例

  • 输入#1

    3 2
    

    输出#1

    1.154700538379 1.632993161855
    
  • 输入#2

    2 100000
    

    输出#2

    70710.678118654752
    

说明/提示

Definition of isosceles triangle: https://en.wikipedia.org/wiki/Isosceles_triangle.

首页