Comments

It means that you need to read and write data not from and to console, but from and to file. Put this :

freopen("input.txt", "r", stdin);

freopen("output.txt", "w", stdout);

In your main function.

int main() {
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
        
        /* Solution */
}