arrow.cpp: In function 'int main()':
arrow.cpp:17:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j=0;j<v[i].size();j++){
~^~~~~~~~~~~~
arrow.cpp:19:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(j==(v[i].size()-1) && v[i].size()>1) ans+=(ll)(v[i][j]-v[i][j-1]);
~^~~~~~~~~~~~~~~~~
arrow.cpp:20:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(v[i].size()>2 && j>0 && j<v[i].size()-1) ans+=(ll)min(v[i][j+1]-v[i][j],v[i][j]-v[i][j-1]);
~^~~~~~~~~~~~~~
arrow.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
~~~~~^~~~~~~~~
arrow.cpp:12:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=0;i<n;i++) scanf("%d%d",&a[i].first,&a[i].second);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~