#include <cstdio>
using namespace std;
#define sci(x) int x;scanf("%d",&x);
#define scii(x, y) int x,y;scanf("%d%d",&x,&y);
#define REP(i, y) for(int i=0;i<y;i++)
int main() {
scii(L,H)
sci(N)
REP(i, N) {
sci(A)
int ans;
if (L <= A && A <= H)
ans = 0;
else if (H < A)
ans = -1;
else if (A < L)
ans = L - A;
printf("%d\n",ans);
}
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:4:47: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
#define scii(x, y) int x,y;scanf("%d%d",&x,&y);
^
./Main.cpp:7:3: note: in expansion of macro ‘scii’
scii(L,H)
^
./Main.cpp:3:36: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
#define sci(x) int x;scanf("%d",&x);
^
./Main.cpp:8:3: note: in expansion of macro ‘sci’
sci(N)
^
./Main.cpp:3:36: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
#define sci(x) int x;scanf("%d",&x);
^
./Main.cpp:10:5: note: in expansion of macro ‘sci’
sci(A)
^