#include #include using namespace std; int main() { int N, M, P, Q; cin >> N >> M >> P >> Q; int month = 0; int i = 1; while (true) { if (i >= P && i <= P + (Q - 1)) { N -= M*2; month++; } else { N -= M; month++; } i++; if(i == 13)i = 1; if(N <= 0)break; } cout << month << endl; return 0; }