ATTENTION: For this problem, do not use the stdin/stdout method for interactive tasks!
We've reimplemented the problem using the new function-call style. You will need to implement two functions:
void init(int N, int R, int Q, int S[], int H[]) - called once at the start, do all your initialization here.
int query(int r1, int r2) - called Q times, once for each query. For each call, return the correct answer to the query.
These functions are in regions.h. All important files are provided in the attachments, including a sample grader.