#include using namespace std; int main() { int n, d; cin>>n>>d; int t[n], k[n]; for (int i=0; i>t[i]>>k[i]; } long long dp[n][2]; for (int i=0; i