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); } })
点赞 评论

相关推荐

迷茫的大四🐶:都收获五个了,兄弟那还说啥,不用改了,去玩吧
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务