#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
const ll INF = 1e9+100;
const ll MOD = 1e9;
const double EPS = 1e-10;
const bool debug = 1;
//------------------------------//
int N;
int a[112345], b[112345];
int cnt[86400];
int main() {
cin >> N;
REP(i, N) scanf("%d %d", a + i, b + i);
int day = 86400, ear = 10800;
int t = 0;
REP(i, N) {
t = (t + a[i]) % day;
cnt[t]++;
t = (t + b[i]) % day;
}
int r = 0, now = 0;
int ans = 0;
REP(l, day) {
while ((r - l + day) % day < ear) {
now += cnt[r];
r = (r + 1) % day;
}
chmax(ans, now);
now -= cnt[l];
}
chmax(ans, now);
cout << ans << endl;
return 0;
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:26:40: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
REP(i, N) scanf("%d %d", a + i, b + i);
^