toy.cpp: In function 'void f(int, int, int)':
toy.cpp:12:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (ind >= d.size()) return;
~~~~^~~~~~~~~~~
toy.cpp: In function 'int main()':
toy.cpp:41:27: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::set<int>::size_type {aka long unsigned int}' [-Wformat=]
printf("%d\n", ans.size());
~~~~~~~~~~^
toy.cpp:27:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~