xylophone.cpp: In function 'void solve(int)':
xylophone.cpp:17:19: error: 'l' was not declared in this scope
17 | if(a[i] == 0) l = i;
| ^
xylophone.cpp:18:23: error: 'r' was not declared in this scope
18 | if(a[i] == n - 1) r = i;
| ^
xylophone.cpp:20:42: error: 'l' was not declared in this scope
20 | for(int i = 1; i <= n; i++) answer(i, (l < r) ? a[i] + 1 : n - a[i]);
| ^
xylophone.cpp:20:46: error: 'r' was not declared in this scope
20 | for(int i = 1; i <= n; i++) answer(i, (l < r) ? a[i] + 1 : n - a[i]);
| ^
xylophone.cpp:14:7: warning: unused variable 'u' [-Wunused-variable]
14 | int u, v;
| ^
xylophone.cpp:14:10: warning: unused variable 'v' [-Wunused-variable]
14 | int u, v;
| ^