Pagini recente »
Istoria paginii runda/prega_oji2015_v_1
|
Cod sursă (job #416526)
|
Cod sursă (job #362867)
|
test_cerc_clasa_a_7-a
|
Cod sursă (job #470628)
Cod sursă (job
#470628)
#include <bits/stdc++.h>
using namespace std;
int i,j,c,m,x,t,k;
int b,a;
int main()
{
ifstream cin("scv.in");
ofstream cout("scv.out");
cin >> c >> t >> m >> x;
k=m;
while (a<x)
{
while (a<min(x,c)){
++b;
a=a+m;}
if (a+m*t+m*(c/k)<x)
{
a=a+(m*t-c);
b=t+b;
m=m+k;
}else
{
if ((x-a)%m!=0) b++;
b=b+(x-a)/m; a=x;
}
}
cout << b;
return 0;
}