const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }) rl.on('line', function(line) { line = line.split(' '); var x = +line[0], f = +line[1], d = +line[2], p = +line[3]; if (d === 0) { console.log(0) } else if (parseInt(d / x) <= f) { console.log(parseInt(d / x)) } else { var rest = d - x * f; var day = Math.floor(rest / (x + p)); console.log(f + day); } })
点赞 评论

相关推荐

karis_aqa:和hr没关系,都是打工的
点赞 评论 收藏
分享
09-28 22:01
已编辑
广西科技大学 IT技术支持
合适才能收到offe...:找桌面运维?
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务