Main.cc: In function ‘int main()’:
Main.cc:26:15: error: ‘cnt’ was not declared in this scope
while ( k < cnt && g [k] < a [i] )
^~~
Main.cc:26:15: note: suggested alternative: ‘int’
while ( k < cnt && g [k] < a [i] )
^~~
int