use proconio::{input, source::line::LineSource}; use std::io::{stdin, stdout, BufReader, Write}; fn main() { let mut source = LineSource::new(BufReader::new(stdin().lock())); let mut x = 1e9 as usize / 2; while x > 0 { println!("{}", x); stdout().flush().unwrap(); input! { from &mut source, result: i8, } if result == 1 { return; } else if result == 0 { x /= 2; } } }