#include <bits/stdc++.h>
#ifndef SKY
#include "apziplib.h"
#endif // SKY
using namespace std;
#define ll long long
#define pb push_back
#define N 1000010
#define ii pair<int,int>
#define fs first
#define sc second
#define ld double
#define int ll
int n,A,B;
vector<ii>s;
int32_t main()
{
#ifdef SKY
freopen("A.inp","r",stdin);
freopen("A.out","w",stdout);
#endif // SKY
ios::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
cin>>n>>A>>B;
for(int i=1;i<=n;i++)
{
int l,r;
cin>>l>>r;
for(int t=l;t<=r;t++)
s.pb({(t+t/B)%A,t%B});
}
sort(s.begin(),s.end());
s.erase(unique(s.begin(),s.end()),s.end());
cout<<s.size();
return 0;
}
Compilation message
strange_device.cpp:3:10: fatal error: apziplib.h: No such file or directory
3 | #include "apziplib.h"
| ^~~~~~~~~~~~
compilation terminated.