C语言题目“CD Making”我编出来了,但在网页上提交时总提示wrong answer,求大神帮忙检查下哪里错了
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/13 08:34:29
C语言题目“CD Making”我编出来了,但在网页上提交时总提示wrong answer,求大神帮忙检查下哪里错了
Tom has N songs and he would like to record them into CDs.A single CD can contain at most K songs.In addition,Tom is very superstitious and he believes the number '13' would bring bad luck,so he will never let a CD contain exactly 13 songs.Tom wants to use as few CDs as possible to record all these songs.Please help him.
There are T test cases.The first line gives T,number of test cases.T lines follow,each contains N and K,number of songs Tom wants to record into CDs,and the maximum number of songs a single CD can contain.
1 ≤ N ≤ 1000,1 ≤ K ≤ 1000
For each test case,output the minimum number of CDs required,if the above constraints are satisfied.
Sample Input
2
5 2
13 13
Sample Output
3
2
#include
#include
int main()
{
int T,N,K,n;
scanf("%d",&T);
for(;T>0;T--)
{
scanf("%d%d",&N,&K);
if(K
Tom has N songs and he would like to record them into CDs.A single CD can contain at most K songs.In addition,Tom is very superstitious and he believes the number '13' would bring bad luck,so he will never let a CD contain exactly 13 songs.Tom wants to use as few CDs as possible to record all these songs.Please help him.
There are T test cases.The first line gives T,number of test cases.T lines follow,each contains N and K,number of songs Tom wants to record into CDs,and the maximum number of songs a single CD can contain.
1 ≤ N ≤ 1000,1 ≤ K ≤ 1000
For each test case,output the minimum number of CDs required,if the above constraints are satisfied.
Sample Input
2
5 2
13 13
Sample Output
3
2
#include
#include
int main()
{
int T,N,K,n;
scanf("%d",&T);
for(;T>0;T--)
{
scanf("%d%d",&N,&K);
if(K
k=15,n=13 这个数据你考虑一下
C语言题目“CD Making”我编出来了,但在网页上提交时总提示wrong answer,求大神帮忙检查下哪里错了
ACM大神帮我看下哪里出问题了,提交后老是显示Wrong Answer at Test 1
POJ 1001 wrong answer ,我试了下题目上面给的例子,答案全部一样,可是提交时总是Wrong answ
C语言编的约瑟夫问题(猴子选大王)求大神看哪里错了
北大ACM第1006,我用C语言写的,调试时都是成功的为什么提交时出现Wrong Answer;请各位C语言大虾们看看
请问这个C语言程序哪里出错了?验证时总提示有一个错误.
求C语言大神帮忙看看哪错了
趣味C语言问题我想编一个程序:像我们在银行输入自己的密码一样,每输入一个数字它就只显示*(星号)出来.我编了一个程序,但
求大神帮忙画mathematica的图.我找不出来哪儿错了.C和c不一样哦~
北大ACM1001的题目,怎么提交都是wrong answer,帮我看看
C语言编程,求我错在哪里了,目标:求圆柱体表面积和体积.
C语言求同构数,大神们帮我看看我做的哪里出错了啊.我是C语言新手啊.