include <iostream> using namespace std; int main(){ int HP; cin >> HP; int normal; cin >> normal; int buffer; cin >> buffer; if (HP <= normal) { cout << 1; return 0; } else if (HP <= buffer) { cout << 2; return 0; } if (2 * normal >= buffer) { cout << HP%normal ? HP / normal + 1 : HP / normal; } else { if (!(HP%buffer)) { cout << HP / buffer * 2; } else { if (HP%buffer <= normal) { cout << HP / buffer * 2 + 1; } else { cout << HP / buffer * 2 + 2; } } } system("pause"); return 0; }
点赞 评论

相关推荐

東大沒有派對:这是好事啊(峰哥脸
我的秋招日记
点赞 评论 收藏
分享
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务