Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

By solving this problem, you can learn (or reconfirm) how to implement binary search.

The output is self-descriptive. Please read it and consider what is going on.

In this implementation, the lower boundary of the value range is inclusive

and the upper boundary is exclusive.

The initial value of the lower boundary is zero. The upper boundary is given

in the first line of the input.

Then you must make a query whether the value is in the lower half of the range.

The answer to the query, expressed as 1 for yes or 0 for no, is given in the

next line of the input.

Repeat the above until you can determine the value which is an integer.

You must ignore the remaining input that is just a garbage.

-- tails

exec is denied

no deadline, the server will not save your submission

1024 1 1 1 0 0 1 1 0 1 1 0 0 1

Now I know the value is not less than 0 but less than 1024. Is the value less than 512? Yes! Now I know the value is not less than 0 but less than 512. Is the value less than 256? Yes! Now I know the value is not less than 0 but less than 256. Is the value less than 128? Yes! Now I know the value is not less than 0 but less than 128. Is the value less than 64? No! Now I know the value is not less than 64 but less than 128. Is the value less than 96? No! Now I know the value is not less than 96 but less than 128. Is the value less than 112? Yes! Now I know the value is not less than 96 but less than 112. Is the value less than 104? Yes! Now I know the value is not less than 96 but less than 104. Is the value less than 100? No! Now I know the value is not less than 100 but less than 104. Is the value less than 102? Yes! Now I know the value is not less than 100 but less than 102. Is the value less than 101? Yes! Now I know the value is not less than 100 but less than 101. That is, the value is 100.

3456 1 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0

Now I know the value is not less than 0 but less than 3456. Is the value less than 1728? Yes! Now I know the value is not less than 0 but less than 1728. Is the value less than 864? No! Now I know the value is not less than 864 but less than 1728. Is the value less than 1296? Yes! Now I know the value is not less than 864 but less than 1296. Is the value less than 1080? No! Now I know the value is not less than 1080 but less than 1296. Is the value less than 1188? No! Now I know the value is not less than 1188 but less than 1296. Is the value less than 1242? Yes! Now I know the value is not less than 1188 but less than 1242. Is the value less than 1215? No! Now I know the value is not less than 1215 but less than 1242. Is the value less than 1228? No! Now I know the value is not less than 1228 but less than 1242. Is the value less than 1235? Yes! Now I know the value is not less than 1228 but less than 1235. Is the value less than 1231? No! Now I know the value is not less than 1231 but less than 1235. Is the value less than 1233? No! Now I know the value is not less than 1233 but less than 1235. Is the value less than 1234? No! Now I know the value is not less than 1234 but less than 1235. That is, the value is 1234.

7777 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0

Now I know the value is not less than 0 but less than 7777. Is the value less than 3888? No! Now I know the value is not less than 3888 but less than 7777. Is the value less than 5832? Yes! Now I know the value is not less than 3888 but less than 5832. Is the value less than 4860? No! Now I know the value is not less than 4860 but less than 5832. Is the value less than 5346? No! Now I know the value is not less than 5346 but less than 5832. Is the value less than 5589? Yes! Now I know the value is not less than 5346 but less than 5589. Is the value less than 5467? No! Now I know the value is not less than 5467 but less than 5589. Is the value less than 5528? No! Now I know the value is not less than 5528 but less than 5589. Is the value less than 5558? Yes! Now I know the value is not less than 5528 but less than 5558. Is the value less than 5543? No! Now I know the value is not less than 5543 but less than 5558. Is the value less than 5550? No! Now I know the value is not less than 5550 but less than 5558. Is the value less than 5554? No! Now I know the value is not less than 5554 but less than 5558. Is the value less than 5556? Yes! Now I know the value is not less than 5554 but less than 5556. Is the value less than 5555? No! Now I know the value is not less than 5555 but less than 5556. That is, the value is 5555.

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | Histocrat | 184 | 0.0461 | 2016/08/20 13:54:15 | 0B / 90B / 77B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | %20 | 176 | 0.0406 | 2016/08/18 13:46:22 | 0B / 68B / 91B |

2 | tails | 269 | 0.0380 | 2016/08/18 11:05:05 | 0B / 150B / 78B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | hallvabo | 184 | 0.1268 | 2017/01/08 06:11:26 | 101B / 54B / 25B |

2 | twobit | 197 | 0.0989 | 2017/01/07 01:27:15 | 115B / ?B / ?B |

3 | hallvabo (nobin) | 213 | 0.1089 | 2017/01/08 05:41:54 | 0B / 113B / 81B |

4 | Sp3000 | 216 | 0.1021 | 2016/08/29 15:19:52 | 0B / 113B / 85B |

5 | test | 256 | 0.1215 | 2017/01/07 00:31:49 | 0B / ?B / ?B |

6 | rolf | 257 | 0.0974 | 2016/08/19 03:36:44 | 0B / 151B / 75B |

Rank | User | Size | Time | Date | Statistics |
---|---|---|---|---|---|

1 | kotatsugame | 247 | 0.0320 | 2017/02/01 23:17:41 | 0B / 144B / 80B |

2 | nai | 248 | 0.0355 | 2016/12/20 00:35:16 | 0B / 149B / 75B |

3 | yangfl | 260 | 0.0357 | 2016/10/27 23:37:56 | 0B / 151B / 85B |

Rank | Lang | User | Size | Score |
---|---|---|---|---|

1 | Perl | %20 | 176 | 10000 |

2 | Ruby | Histocrat | 184 | 9565 |

3 | Python | hallvabo | 184 | 9565 |

4 | C | kotatsugame | 247 | 7125 |