#include #include #include int main() { int64_t n, l, h; std::cin >> n >> l >> h; std::vector p(n); for(int i=0; i> p[i]; int best = 0; int worst = std::numeric_limits::max(); for(int L = l; L <= h; L++) { std::vector rolling(n+L+1); rolling[0] = 0; for(int i=0; i= 0) cur -= p[prev]; if(i < n) cur += p[i]; rolling[i+1] = cur; } for(int start = 0; start < L; start++) { int cur = start; int profitable = 0; while(cur <= n+L) { if(rolling[cur] > 0) profitable++; cur += L; } if(profitable > best) best = profitable; if(profitable < worst) worst = profitable; } } std::cout << worst << " " << best << std::endl; }