题解 | #牛客春招训练营#小红浏览论坛
小红浏览论坛
https://www.nowcoder.com/practice/07606940c60e4746a645052d7502efd5
// #牛客春招刷题训练营# https://www.nowcoder.com/discuss/726480854079250432
// 模拟题
#include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int n, x;
cin >> n >> x;
int a, b, ans = 0;
for (int i = 0; i < n; i++){
cin >> a >> b;
if(a - b >= x || a - b <= -x){
ans++;
}
}
cout << ans;
}
// 64 位输出请用 printf("%lld")
