2476.cpp

来自「这是哈尔滨工业大学acmOJ的源代码」· C++ 代码 · 共 17 行

CPP
17
字号
/* This Code is Submitted by wywcgs for Problem 2476 on 2007-04-16 at 11:05:24 */
#include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
	int t, s, f, n, d;
	
	while(scanf("%d %d %d %d %d", &t, &s, &f, &n, &d) != EOF) {
		int step = n+(d-1)/s*(n-1)+(2*f+s-1)/(2*s)+((t-f-(n-1)*d)*2+s-1)/(2*s);
		printf("%d\n", step);
	}
	
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?