304136: CF794B. Cutting Carrot

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Cutting Carrot

题意翻译

---------------- 有一根高为$h$,底为$1$的胡萝卜(姑且可以认为它就是一个三角形),欲将其水平切成$n$段(水平即每一刀都平行于底边),使每一段面积相等。 ### 输入格式 一行2个数$n$,$h$ ### 输出格式 从上而下输出$h-$每一刀所在的高度,要求程序的答案与数据的误差小于0.0000001 ---------------------------

题目描述

Igor the analyst has adopted $ n $ 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 $ n $ pieces of equal area. Formally, the carrot can be viewed as an isosceles triangle with base length equal to $ 1 $ and height equal to $ h $ . Igor wants to make $ n-1 $ cuts parallel to the base to cut the carrot into $ n $ pieces. He wants to make sure that all $ n $ pieces have the same area. Can you help Igor determine where to cut the carrot so that each piece have equal area? ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF794B/e0a493727cae2e59335accfa3d0c200bda3f1ec1.png)Illustration to the first example.

输入输出格式

输入格式


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

输出格式


The output should contain $ n-1 $ real numbers $ x_{1},x_{2},...,x_{n-1} $ . The number $ x_{i} $ denotes that the $ i $ -th cut must be made $ x_{i} $ units away from the apex of the carrot. In addition, $ 0&lt;x_{1}&lt;x_{2}&lt;...&lt;x_{n-1}&lt;h $ must hold. Your output will be considered correct if absolute or relative error of every number in your output doesn't exceed $ 10^{-6} $ . Formally, let your answer be $ a $ , and the jury's answer be $ b $ . Your answer is considered correct if ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF794B/259203790d90e969d73ec841bd0673c1e8e7d69a.png).

输入输出样例

输入样例 #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](https://en.wikipedia.org/wiki/Isosceles_triangle).

Input

题意翻译

---------------- 有一根高为$h$,底为$1$的胡萝卜(姑且可以认为它就是一个三角形),欲将其水平切成$n$段(水平即每一刀都平行于底边),使每一段面积相等。 ### 输入格式 一行2个数$n$,$h$ ### 输出格式 从上而下输出$h-$每一刀所在的高度,要求程序的答案与数据的误差小于0.0000001 ---------------------------

加入题单

上一题 下一题 算法标签: