Input Data is pretty big (25 MB) so use faster IO code example Example: Input Data is pretty big (25 MB) so use faster IO ios_base::sync_with_stdio(false);