Hey guys,
This is my first post, so please correct me on any missing etiquette 
To try to speed up the code I changed cin/cout to scanf/printf but that failed to correct the TLE error. Any further suggestions on things to check out?
Thanks guys!
code redacted