1196 faster implementation using stdin
1196 enhanced input reading time
1196 AC