prog.cpp:1:6: error: ‘tuple’ in namespace ‘std’ does not name a template type
std::tuple<int, int, int> egcd(int a, int b){
^~~~~
prog.cpp:1:1: note: ‘std::tuple’ is defined in header ‘<tuple>’; did you forget to ‘#include <tuple>’?
+#include <tuple>
std::tuple<int, int, int> egcd(int a, int b){
^~~
prog.cpp: In function ‘int modinv(int, int)’:
prog.cpp:9:6: error: ‘tie’ is not a member of ‘std’
std::tie(gcd, x, y) = egcd(a, m);
^~~
prog.cpp:9:23: error: ‘egcd’ was not declared in this scope
std::tie(gcd, x, y) = egcd(a, m);
^~~~
prog.cpp:9:23: note: suggested alternative: ‘gcd’
std::tie(gcd, x, y) = egcd(a, m);
^~~~
gcd