#include using namespace std; using ll = long long; using PII = std::pair; using PLL = std::pair; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) struct player { string name; int time; int total; vector points; }; int main() { #ifdef DEBUG cout << "DEBUG MODE" << endl; ifstream in("input.txt"); //for debug cin.rdbuf(in.rdbuf()); //for debug #endif int n, k, a, t, l, r, d; ll ans; cin >> n >> k >> ans; k++; int num[n]; vector minprice, maxprice; deque deqmin, deqmax; rep(i, n) { cin >> a; t = k + i; while (!deqmin.empty()) { if (deqmin.front().second <= i) deqmin.pop_front(); else break; } while (!deqmin.empty()) { if (deqmin.back().first >= a) deqmin.pop_back(); else break; } deqmin.push_back(make_pair(a, t)); while (!deqmax.empty()) { if (deqmax.front().second < deqmin.front().second) deqmax.pop_front(); else break; } while (!deqmax.empty()) { if (deqmax.back().first <= a) deqmax.pop_back(); else break; } deqmax.push_back(make_pair(a, t)); minprice.push_back(deqmin.front()); maxprice.push_back(deqmax.front()); // for (auto z : deqmin) // cout << z.first << " "; // cout << endl; } d = 0; rep(i, n) { if (d < maxprice[i].first - minprice[i].first) { d = maxprice[i].first - minprice[i].first; l = minprice[i].second - k; r = maxprice[i].second - k; } } cout << ans * d << endl; if (d != 0) cout << l << " " << r <