# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
529205 | Devigo | Rainforest Jumps (APIO21_jumps) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n, q;
cin >> n >> q;
vector<int> h(n);
for(int i=0; i<n; i++)
cin >> h[i];
while(q--)
{
int a,b, c, d;
cin >> a >> b >> c >> d;
if(d<a)
{
cout << "-1\n";
continue;
}
int dis = c-b;
cout << dis << "\n";
}
return 0;
}