CF18B Platforms--题解报告
题目
题目描述
In one one-dimensional world there are nn platforms. Platform with index kk (platforms are numbered from 1) is a segment with coordinates [(k-1)m,(k-1)m+l][(k−1)m,(k−1)m+l] , and l The first input line contains 4 integer numbers nn , dd , mm , ll ( 1<=n,d,m,l<=10^{6},l Output the coordinates of the point, where the grosshopper will fall down. Don't forget that if Bob finds himself on the platform edge, he doesn't fall down. 题目描述:在一坐标轴上给出n块板子,每个板子所占的空间为[(k-1)m,(k-1)m+l](l Translated by 稀神探女 输入 #1复制 输出 #1复制 输入 #2复制 输出 #2复制 其实这题,关键是要看懂题目。 简单来说就是,从原点起跳,每次跳的距离为d,跳到没有板子的地方就停止了。有n块板子,每块板子一样长,长度为l,板子和板子之间有间隙,题目中的k其实是板子的编号,从1到n。那么板子与板子之间的距离其实就是(m-l)。 大概就是图画的那样 题目看懂了那么题目就很好写了输入格式
输出格式
题意翻译
输入输出样例
2 2 5 3
4
5 4 11 8
20
思路

代码展示
#include本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
