paprike.cpp: In function 'int main()':
paprike.cpp:38:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
38 | scanf("%d%d", &n, &K);
| ~~~~~^~~~~~~~~~~~~~~~
paprike.cpp:39:39: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
39 | for (int i = 1; i <= n; ++i) scanf("%d", a+i);
| ~~~~~^~~~~~~~~~~
paprike.cpp:40:44: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
40 | for (int u, v, i = 1; i < n; ++i) scanf("%d%d", &u, &v), g[u].push_back(v), g[v].push_back(u);
| ~~~~~^~~~~~~~~~~~~~~~