telegraph.cpp: In function 'int main()':
telegraph.cpp:20:6: warning: variable 'last' set but not used [-Wunused-but-set-variable]
int last=-1;
^~~~
telegraph.cpp:12:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%i",&n);
~~~~~^~~~~~~~~
telegraph.cpp:14:71: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=1;i<=n;i++) scanf("%i %i",&a[i],&c[i]),E[a[i]].pb({c[i],i}),sum+=c[i];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~