兰州烧饼
Time Limit:1000MS Memory Limit:65536K
Total Submit:29 Accepted:25
Description
烧饼有两面,要做好一个兰州烧饼,要两面都弄热。当然,一次只能弄一个的话,效率就太低了。有这么一个大平底锅,一次可以同时放入k个兰州烧饼,一分钟能做好一面。而现在有n个兰州烧饼,至少需要多少分钟才能全部做好呢?
Input
依次输入n和k,中间以空格分隔,其中1 <= k,n <= 100000
Output
输出全部做好至少需要的分钟数
Sample Input
3 2
Sample Output
3
Hint
如样例,三个兰州烧饼编号a,b,c,首先a和b,然后a和c,最后b和c,3分钟完成
Source
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AK1173 {
class Program {
static void Main(string[] args) {
string[] sb = Console.ReadLine().Split();
int n = int.Parse(sb[0]), k = int.Parse(sb[1]);
if (2 * n % k == 0) Console.WriteLine(2 * n / k);//总共2n面,如果可以整除
else Console.WriteLine(2 * n / k + 1);//不能整除+1
}
}
}