#include using namespace std; int main(){ int N, X; cin >> N >> X; vector A(N), B(N); for (int i = 0; i < N; i++){ cin >> A[i] >> B[i]; } for (int j = 1; j <= X; j++){ int ans = 0; for (int i = 0; i < N; i++){ ans = max(ans, B[i] - abs(j - A[i])); } cout << ans << endl; } }