Use of cout and scanf

I was getting TLE(1.01sec) when cout and cin were there. Then I replaced these with printf and scanf and my answer got accepted with runtime 0.2 sec. Is it possible?

yes, scanf and printf are faster than cin and cout.
but if you add this in your code in main function it will with increase speed (for cin , cout )

I did but still it is showing tle with cin and cout