Codeforces965—A:Paper Airplanes(思维)
鏈接:Codeforce965—A題傳送門
題目
To make a paper airplane, one has to use a rectangular piece of paper. From a sheet of standard size you can make s airplanes.
A group of k people decided to make n airplanes each. They are going to buy several packs of paper, each of them containing p sheets, and then distribute the sheets between the people. Each person should have enough sheets to make n airplanes. How many packs should they buy?
題意
k個人要疊紙飛機,每個人要疊n個紙飛機,一張紙能疊s個飛機,買紙只能一包一包買,一包有p張紙。
問你他們最少要買幾包紙?
思路
題目有點繞,看清楚每個變量的意義。
首先算出每個人需要幾張紙,然后算出一共需要多少張,最后算一下要多少包就好。
需要注意的是第二個樣例中,一張紙能疊100個飛機,但是我們還是只疊一個。所以就是寧可浪費也不少買。(杜絕浪費!)
看一下代碼,伊麗莎白!
代碼
水水水~~
總結(jié)
以上是生活随笔為你收集整理的Codeforces965—A:Paper Airplanes(思维)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DS线性表—多项式相加
- 下一篇: 08-OS X系统中将control和c