Contest Preparation

Contest Preparation

https://ac.nowcoder.com/acm/contest/34866/B

链接:https://ac.nowcoder.com/acm/contest/34866/B 来源:牛客网

Walk_alone is anxious to prepare for a programming contest, and he has ideas for nn problems now. Preparing a problem from scratch requires two jobs: making and validating. He asked mm people to help him with these two jobs.

All these mm people are skilled at making and validating problems, and each person needs exactly 11 hour to do one of these two jobs. A job should be done by only one person without interruption (but making and validating one problem can be done by two different people), and a problem must be made before validated. Now Walk_alone wants to know the minimum hours to prepare for the contest if he arranges everyone's job properly.

#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 50;
typedef long long ll;
string str[55];
int main() {

	int  t;
	cin >> t;
	while (t--) {
		ll n, m;
		cin >> n >> m;
		if (n == 0) {
			cout << 0 << endl;
			continue;
		}
		if (n > 0 && n <= m) {
			cout << 2 << endl; 
			continue;
		}
		if (n > m) {
			cout << (n*2 +m - 1)/m<<endl ;
            continue ;
		}
	}    
	return 0;
}

A problem which is easy Fractional expression .

凉心哥哥的小宝藏 文章被收录于专栏

c++

全部评论

相关推荐

面了这么多场试,总有公司总喜欢压力面一个小时面试+手撕,哪里不会就点哪里,说了不会不会还继续追着问不尊重求职者,稍微有些细节记不清了,就开始怀疑项目真实性以及人格让求职者开摄像头但是自己不开,说话声音还贼小,pardon几次就开始不耐烦的不知道这个算不算,手撕的时候,面试官人跑了。。。最后快结束才来
一纸丿繁华丶:你换位思考一下,自己在职场被领导push麻了,身心俱疲,现在有个机会让你放松一下,体验一把上位者的感觉,还能看着那些高学历人才、未来自己的竞争者,抓耳挠腮、手足无措的样子,没给你当场笑出来就不错了,理解一下面试官吧。
点赞 评论 收藏
分享
05-12 11:09
已编辑
门头沟学院 后端
已注销:没必要放这么多专业技能的描述。这些应该是默认已会的,写这么多行感觉在凑内容。项目这块感觉再包装包装吧,换个名字,虽然大家的项目基本都是网上套壳的,但是你这也太明显了。放一个业务项目,再放一个技术项目。技术项目,例如中间件的一些扩展和尝试。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务