题解 | #牛牛拉票#
牛牛拉票
http://www.nowcoder.com/questionTerminal/fa52db71904542ae99ee4e373fd95679
// const { parse } = require('path');
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
//这里代表题目中设定好的输入的行数
var rows = []; //用于存储每行的输入
rl.on('line', function (line) {
rows.push(line);//将每次输入的行数据存入
//当输入的行数等于设定的k值时,开始逻辑处理
let t = parseInt(rows[0])
if(t == rows.length-1){
for(let i = 1; i < rows.length; i++){
let l = parseInt(rows[i].split(' ')[0])//不少于L
let d = parseInt(rows[i].split(' ')[1])//D天
let s = parseInt(rows[i].split(' ')[2])
let c = parseInt(rows[i].split(' ')[3])
for(let j = 0; j < d-1; j++){
s = s*(c+1)
}
if(s < l){
console.log('NO')
}else{
console.log('YES')
}
}
rows.length = 0;//状态重置
}
// for (let i = 0; i < l2.length; i++) {
// l2[i] = parseInt(l2[i])
// }
// console.log(rows)
// console.log(a, b)
});
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
//这里代表题目中设定好的输入的行数
var rows = []; //用于存储每行的输入
rl.on('line', function (line) {
rows.push(line);//将每次输入的行数据存入
//当输入的行数等于设定的k值时,开始逻辑处理
let t = parseInt(rows[0])
if(t == rows.length-1){
for(let i = 1; i < rows.length; i++){
let l = parseInt(rows[i].split(' ')[0])//不少于L
let d = parseInt(rows[i].split(' ')[1])//D天
let s = parseInt(rows[i].split(' ')[2])
let c = parseInt(rows[i].split(' ')[3])
for(let j = 0; j < d-1; j++){
s = s*(c+1)
}
if(s < l){
console.log('NO')
}else{
console.log('YES')
}
}
rows.length = 0;//状态重置
}
// for (let i = 0; i < l2.length; i++) {
// l2[i] = parseInt(l2[i])
// }
// console.log(rows)
// console.log(a, b)
});