#include using namespace std; int main(){ int N; int64_t L, X[100000], Y[100000]; cin >> N >> L; for(int i=0; i> X[i]; for(int i=0; i> Y[i]; vector> order; for(int i=0; i mx){ mx = now; pos = p.first; } } int64_t ans = (mx-1) * L + pos; cout << ans << endl; return 0; }