CCCherry

导航

0323C - Cupboard and Balloons

C - Cupboard and Balloons

 1 #include <iostream>
 2 #include <cmath>
 3 using namespace std;
 4 int main()
 5 {
 6     int r,h,sum=0;
 7     cin>>r>>h;
 8     sum=h/r*2;
 9     if(h%r<r*0.5) sum+=1;
10     else if(h%r<sqrt(3)*0.5*r){
11         sum+=2;
12     }
13     else sum+=3;
14     cout<<sum;
15 }

 

posted on 2020-03-23 21:52  CCCherry  阅读(110)  评论(0编辑  收藏  举报