QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#825088#9770. Middle Pointucup-team296#AC ✓0ms2348kbRust16.5kb2024-12-21 17:18:322024-12-21 17:18:39

Judging History

你现在查看的是最新测评结果

  • [2024-12-21 17:18:39]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:2348kb
  • [2024-12-21 17:18:32]
  • 提交

answer

// https://contest.ucup.ac/contest/1873/problem/9770
use crate::algo_lib::io::input::Input;
use crate::algo_lib::io::output::Output;
use crate::algo_lib::misc::test_type::TaskType;
use crate::algo_lib::misc::test_type::TestType;
type PreCalc = ();
fn solve(input: &mut Input, out: &mut Output, _test_case: usize, _data: &mut PreCalc) {
    let a = input.read_int();
    let b = input.read_int();
    let mut x = input.read_int();
    let mut y = input.read_int();
    let mut ans = Vec::new();
    for _ in 0..32 {
        if (x == 0 || x == a) && (y == 0 || y == b) {
            out.print_line(ans.len());
            ans.reverse();
            out.print_per_line(&ans);
            return;
        }
        if x <= a / 2 {
            if y <= b / 2 {
                ans.push((0, 0, 2 * x, 2 * y));
                x *= 2;
                y *= 2;
            } else {
                ans.push((0, b, 2 * x, b - 2 * (b - y)));
                x *= 2;
                y = b - 2 * (b - y);
            }
        } else {
            if y <= b / 2 {
                ans.push((a, 0, a - 2 * (a - x), 2 * y));
                x = a - 2 * (a - x);
                y *= 2;
            } else {
                ans.push((a, b, a - 2 * (a - x), b - 2 * (b - y)));
                x = a - 2 * (a - x);
                y = b - 2 * (b - y);
            }
        }
    }
    out.print_line(-1);
}
pub static TEST_TYPE: TestType = TestType::Single;
pub static TASK_TYPE: TaskType = TaskType::Classic;
pub(crate) fn run(mut input: Input, mut output: Output) -> bool {
    let mut pre_calc = ();
    match TEST_TYPE {
        TestType::Single => solve(&mut input, &mut output, 1, &mut pre_calc),
        TestType::MultiNumber => {
            let t = input.read();
            for i in 1..=t {
                solve(&mut input, &mut output, i, &mut pre_calc);
            }
        }
        TestType::MultiEof => {
            let mut i = 1;
            while input.peek().is_some() {
                solve(&mut input, &mut output, i, &mut pre_calc);
                i += 1;
            }
        }
    }
    output.flush();
    match TASK_TYPE {
        TaskType::Classic => input.is_empty(),
        TaskType::Interactive => true,
    }
}


fn main() {
    let mut sin = std::io::stdin();
    let input = crate::algo_lib::io::input::Input::new(&mut sin);
    let mut stdout = std::io::stdout();
    let output = crate::algo_lib::io::output::Output::new(&mut stdout);
    run(input, output);
}
pub mod algo_lib {
pub mod collections {
pub mod vec_ext {
pub mod default {
pub fn default_vec<T: Default>(len: usize) -> Vec<T> {
    let mut v = Vec::with_capacity(len);
    for _ in 0..len {
        v.push(T::default());
    }
    v
}
}
}
}
pub mod io {
pub mod input {
use crate::algo_lib::collections::vec_ext::default::default_vec;
use std::io::Read;
use std::mem::MaybeUninit;
pub struct Input<'s> {
    input: &'s mut (dyn Read + Send),
    buf: Vec<u8>,
    at: usize,
    buf_read: usize,
}
macro_rules! read_impl {
    ($t:ty, $read_name:ident, $read_vec_name:ident) => {
        pub fn $read_name (& mut self) -> $t { self.read() } pub fn $read_vec_name (& mut
        self, len : usize) -> Vec <$t > { self.read_vec(len) }
    };
    ($t:ty, $read_name:ident, $read_vec_name:ident, $read_pair_vec_name:ident) => {
        read_impl!($t, $read_name, $read_vec_name); pub fn $read_pair_vec_name (& mut
        self, len : usize) -> Vec < ($t, $t) > { self.read_vec(len) }
    };
}
impl<'s> Input<'s> {
    const DEFAULT_BUF_SIZE: usize = 4096;
    pub fn new(input: &'s mut (dyn Read + Send)) -> Self {
        Self {
            input,
            buf: default_vec(Self::DEFAULT_BUF_SIZE),
            at: 0,
            buf_read: 0,
        }
    }
    pub fn new_with_size(input: &'s mut (dyn Read + Send), buf_size: usize) -> Self {
        Self {
            input,
            buf: default_vec(buf_size),
            at: 0,
            buf_read: 0,
        }
    }
    pub fn get(&mut self) -> Option<u8> {
        if self.refill_buffer() {
            let res = self.buf[self.at];
            self.at += 1;
            if res == b'\r' {
                if self.refill_buffer() && self.buf[self.at] == b'\n' {
                    self.at += 1;
                }
                return Some(b'\n');
            }
            Some(res)
        } else {
            None
        }
    }
    pub fn peek(&mut self) -> Option<u8> {
        if self.refill_buffer() {
            let res = self.buf[self.at];
            Some(if res == b'\r' { b'\n' } else { res })
        } else {
            None
        }
    }
    pub fn skip_whitespace(&mut self) {
        while let Some(b) = self.peek() {
            if !b.is_ascii_whitespace() {
                return;
            }
            self.get();
        }
    }
    pub fn next_token(&mut self) -> Option<Vec<u8>> {
        self.skip_whitespace();
        let mut res = Vec::new();
        while let Some(c) = self.get() {
            if c.is_ascii_whitespace() {
                break;
            }
            res.push(c);
        }
        if res.is_empty() { None } else { Some(res) }
    }
    pub fn is_exhausted(&mut self) -> bool {
        self.peek().is_none()
    }
    pub fn is_empty(&mut self) -> bool {
        self.skip_whitespace();
        self.is_exhausted()
    }
    pub fn read<T: Readable>(&mut self) -> T {
        T::read(self)
    }
    pub fn read_vec<T: Readable>(&mut self, size: usize) -> Vec<T> {
        let mut res = Vec::with_capacity(size);
        for _ in 0..size {
            res.push(self.read());
        }
        res
    }
    pub fn read_char(&mut self) -> u8 {
        self.skip_whitespace();
        self.get().unwrap()
    }
    read_impl!(u32, read_unsigned, read_unsigned_vec);
    read_impl!(u64, read_u64, read_u64_vec);
    read_impl!(usize, read_size, read_size_vec, read_size_pair_vec);
    read_impl!(i32, read_int, read_int_vec, read_int_pair_vec);
    read_impl!(i64, read_long, read_long_vec, read_long_pair_vec);
    read_impl!(i128, read_i128, read_i128_vec);
    fn refill_buffer(&mut self) -> bool {
        if self.at == self.buf_read {
            self.at = 0;
            self.buf_read = self.input.read(&mut self.buf).unwrap();
            self.buf_read != 0
        } else {
            true
        }
    }
}
pub trait Readable {
    fn read(input: &mut Input) -> Self;
}
impl Readable for u8 {
    fn read(input: &mut Input) -> Self {
        input.read_char()
    }
}
impl<T: Readable> Readable for Vec<T> {
    fn read(input: &mut Input) -> Self {
        let size = input.read();
        input.read_vec(size)
    }
}
impl<T: Readable, const SIZE: usize> Readable for [T; SIZE] {
    fn read(input: &mut Input) -> Self {
        unsafe {
            let mut res = MaybeUninit::<[T; SIZE]>::uninit();
            for i in 0..SIZE {
                let ptr: *mut T = (*res.as_mut_ptr()).as_mut_ptr();
                ptr.add(i).write(input.read::<T>());
            }
            res.assume_init()
        }
    }
}
macro_rules! read_integer {
    ($($t:ident)+) => {
        $(impl Readable for $t { fn read(input : & mut Input) -> Self { input
        .skip_whitespace(); let mut c = input.get().unwrap(); let sgn = match c { b'-' =>
        { c = input.get().unwrap(); true } b'+' => { c = input.get().unwrap(); false } _
        => false, }; let mut res = 0; loop { assert!(c.is_ascii_digit()); res *= 10; let
        d = (c - b'0') as $t; if sgn { res -= d; } else { res += d; } match input.get() {
        None => break, Some(ch) => { if ch.is_ascii_whitespace() { break; } else { c =
        ch; } } } } res } })+
    };
}
read_integer!(i8 i16 i32 i64 i128 isize u16 u32 u64 u128 usize);
macro_rules! tuple_readable {
    ($($name:ident)+) => {
        impl <$($name : Readable),+> Readable for ($($name,)+) { fn read(input : & mut
        Input) -> Self { ($($name ::read(input),)+) } }
    };
}
tuple_readable! {
    T
}
tuple_readable! {
    T U
}
tuple_readable! {
    T U V
}
tuple_readable! {
    T U V X
}
tuple_readable! {
    T U V X Y
}
tuple_readable! {
    T U V X Y Z
}
tuple_readable! {
    T U V X Y Z A
}
tuple_readable! {
    T U V X Y Z A B
}
tuple_readable! {
    T U V X Y Z A B C
}
tuple_readable! {
    T U V X Y Z A B C D
}
tuple_readable! {
    T U V X Y Z A B C D E
}
tuple_readable! {
    T U V X Y Z A B C D E F
}
impl Read for Input<'_> {
    fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
        if self.at == self.buf_read {
            self.input.read(buf)
        } else {
            let mut i = 0;
            while i < buf.len() && self.at < self.buf_read {
                buf[i] = self.buf[self.at];
                i += 1;
                self.at += 1;
            }
            Ok(i)
        }
    }
}
}
pub mod output {
use crate::algo_lib::collections::vec_ext::default::default_vec;
use std::cmp::Reverse;
use std::io::{stderr, Stderr, Write};
#[derive(Copy, Clone)]
pub enum BoolOutput {
    YesNo,
    YesNoCaps,
    PossibleImpossible,
    Custom(&'static str, &'static str),
}
impl BoolOutput {
    pub fn output(&self, output: &mut Output, val: bool) {
        (if val { self.yes() } else { self.no() }).write(output);
    }
    fn yes(&self) -> &str {
        match self {
            BoolOutput::YesNo => "Yes",
            BoolOutput::YesNoCaps => "YES",
            BoolOutput::PossibleImpossible => "Possible",
            BoolOutput::Custom(yes, _) => yes,
        }
    }
    fn no(&self) -> &str {
        match self {
            BoolOutput::YesNo => "No",
            BoolOutput::YesNoCaps => "NO",
            BoolOutput::PossibleImpossible => "Impossible",
            BoolOutput::Custom(_, no) => no,
        }
    }
}
pub struct Output<'s> {
    output: &'s mut dyn Write,
    buf: Vec<u8>,
    at: usize,
    auto_flush: bool,
    bool_output: BoolOutput,
    precision: Option<usize>,
    separator: u8,
}
impl<'s> Output<'s> {
    const DEFAULT_BUF_SIZE: usize = 4096;
    pub fn new(output: &'s mut dyn Write) -> Self {
        Self {
            output,
            buf: default_vec(Self::DEFAULT_BUF_SIZE),
            at: 0,
            auto_flush: false,
            bool_output: BoolOutput::YesNoCaps,
            precision: None,
            separator: b' ',
        }
    }
    pub fn new_with_auto_flush(output: &'s mut dyn Write) -> Self {
        Self {
            output,
            buf: default_vec(Self::DEFAULT_BUF_SIZE),
            at: 0,
            auto_flush: true,
            bool_output: BoolOutput::YesNoCaps,
            precision: None,
            separator: b' ',
        }
    }
    pub fn flush(&mut self) {
        if self.at != 0 {
            self.output.write_all(&self.buf[..self.at]).unwrap();
            self.output.flush().unwrap();
            self.at = 0;
        }
    }
    pub fn print<T: Writable>(&mut self, s: T) {
        s.write(self);
        self.maybe_flush();
    }
    pub fn print_line<T: Writable>(&mut self, s: T) {
        self.print(s);
        self.put(b'\n');
        self.maybe_flush();
    }
    pub fn put(&mut self, b: u8) {
        self.buf[self.at] = b;
        self.at += 1;
        if self.at == self.buf.len() {
            self.flush();
        }
    }
    pub fn maybe_flush(&mut self) {
        if self.auto_flush {
            self.flush();
        }
    }
    pub fn print_per_line<T: Writable>(&mut self, arg: &[T]) {
        self.print_per_line_iter(arg.iter());
    }
    pub fn print_iter<T: Writable, I: Iterator<Item = T>>(&mut self, iter: I) {
        let mut first = true;
        for e in iter {
            if first {
                first = false;
            } else {
                self.put(self.separator);
            }
            e.write(self);
        }
    }
    pub fn print_line_iter<T: Writable, I: Iterator<Item = T>>(&mut self, iter: I) {
        self.print_iter(iter);
        self.put(b'\n');
    }
    pub fn print_per_line_iter<T: Writable, I: Iterator<Item = T>>(&mut self, iter: I) {
        for e in iter {
            e.write(self);
            self.put(b'\n');
        }
    }
    pub fn set_bool_output(&mut self, bool_output: BoolOutput) {
        self.bool_output = bool_output;
    }
    pub fn set_precision(&mut self, precision: usize) {
        self.precision = Some(precision);
    }
    pub fn reset_precision(&mut self) {
        self.precision = None;
    }
    pub fn get_precision(&self) -> Option<usize> {
        self.precision
    }
    pub fn separator(&self) -> u8 {
        self.separator
    }
    pub fn set_separator(&mut self, separator: u8) {
        self.separator = separator;
    }
}
impl Write for Output<'_> {
    fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
        let mut start = 0usize;
        let mut rem = buf.len();
        while rem > 0 {
            let len = (self.buf.len() - self.at).min(rem);
            self.buf[self.at..self.at + len].copy_from_slice(&buf[start..start + len]);
            self.at += len;
            if self.at == self.buf.len() {
                self.flush();
            }
            start += len;
            rem -= len;
        }
        self.maybe_flush();
        Ok(buf.len())
    }
    fn flush(&mut self) -> std::io::Result<()> {
        self.flush();
        Ok(())
    }
}
pub trait Writable {
    fn write(&self, output: &mut Output);
}
impl Writable for &str {
    fn write(&self, output: &mut Output) {
        output.write_all(self.as_bytes()).unwrap();
    }
}
impl Writable for String {
    fn write(&self, output: &mut Output) {
        output.write_all(self.as_bytes()).unwrap();
    }
}
impl Writable for char {
    fn write(&self, output: &mut Output) {
        output.put(*self as u8);
    }
}
impl Writable for u8 {
    fn write(&self, output: &mut Output) {
        output.put(*self);
    }
}
impl<T: Writable> Writable for [T] {
    fn write(&self, output: &mut Output) {
        output.print_iter(self.iter());
    }
}
impl<T: Writable, const N: usize> Writable for [T; N] {
    fn write(&self, output: &mut Output) {
        output.print_iter(self.iter());
    }
}
impl<T: Writable + ?Sized> Writable for &T {
    fn write(&self, output: &mut Output) {
        T::write(self, output)
    }
}
impl<T: Writable> Writable for Vec<T> {
    fn write(&self, output: &mut Output) {
        self.as_slice().write(output);
    }
}
impl Writable for () {
    fn write(&self, _output: &mut Output) {}
}
macro_rules! write_to_string {
    ($($t:ident)+) => {
        $(impl Writable for $t { fn write(& self, output : & mut Output) { self
        .to_string().write(output); } })+
    };
}
write_to_string!(u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize);
macro_rules! tuple_writable {
    ($name0:ident $($name:ident : $id:tt)*) => {
        impl <$name0 : Writable, $($name : Writable,)*> Writable for ($name0, $($name,)*)
        { fn write(& self, out : & mut Output) { self.0.write(out); $(out.put(out
        .separator); self.$id .write(out);)* } }
    };
}
tuple_writable! {
    T
}
tuple_writable! {
    T U : 1
}
tuple_writable! {
    T U : 1 V : 2
}
tuple_writable! {
    T U : 1 V : 2 X : 3
}
tuple_writable! {
    T U : 1 V : 2 X : 3 Y : 4
}
tuple_writable! {
    T U : 1 V : 2 X : 3 Y : 4 Z : 5
}
tuple_writable! {
    T U : 1 V : 2 X : 3 Y : 4 Z : 5 A : 6
}
tuple_writable! {
    T U : 1 V : 2 X : 3 Y : 4 Z : 5 A : 6 B : 7
}
tuple_writable! {
    T U : 1 V : 2 X : 3 Y : 4 Z : 5 A : 6 B : 7 C : 8
}
impl<T: Writable> Writable for Option<T> {
    fn write(&self, output: &mut Output) {
        match self {
            None => (-1).write(output),
            Some(t) => t.write(output),
        }
    }
}
impl Writable for bool {
    fn write(&self, output: &mut Output) {
        let bool_output = output.bool_output;
        bool_output.output(output, *self)
    }
}
impl<T: Writable> Writable for Reverse<T> {
    fn write(&self, output: &mut Output) {
        self.0.write(output);
    }
}
static mut ERR: Option<Stderr> = None;
pub fn err() -> Output<'static> {
    unsafe {
        if ERR.is_none() {
            ERR = Some(stderr());
        }
        Output::new_with_auto_flush(ERR.as_mut().unwrap())
    }
}
}
}
pub mod misc {
pub mod test_type {
pub enum TestType {
    Single,
    MultiNumber,
    MultiEof,
}
pub enum TaskType {
    Classic,
    Interactive,
}
}
}
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 2136kb

input:

2 2
1 1

output:

1
0 0 2 2

result:

ok correct!

Test #2:

score: 0
Accepted
time: 0ms
memory: 2168kb

input:

8 8
5 0

output:

3
0 0 8 0
0 0 4 0
8 0 2 0

result:

ok correct!

Test #3:

score: 0
Accepted
time: 0ms
memory: 2140kb

input:

0 0
0 0

output:

0

result:

ok correct!

Test #4:

score: 0
Accepted
time: 0ms
memory: 2068kb

input:

2024 0
1012 0

output:

1
0 0 2024 0

result:

ok correct!

Test #5:

score: 0
Accepted
time: 0ms
memory: 2096kb

input:

2024 2024
2023 2023

output:

-1

result:

ok correct!

Test #6:

score: 0
Accepted
time: 0ms
memory: 2008kb

input:

8 6
7 3

output:

3
0 6 8 6
8 6 4 6
8 0 6 6

result:

ok correct!

Test #7:

score: 0
Accepted
time: 0ms
memory: 2068kb

input:

2024 2026
2024 2026

output:

0

result:

ok correct!

Test #8:

score: 0
Accepted
time: 0ms
memory: 2124kb

input:

1000000000 1000000000
70 0

output:

-1

result:

ok correct!

Test #9:

score: 0
Accepted
time: 0ms
memory: 2148kb

input:

3 6
2 4

output:

-1

result:

ok correct!

Test #10:

score: 0
Accepted
time: 0ms
memory: 2124kb

input:

7 7
7 2

output:

-1

result:

ok correct!

Test #11:

score: 0
Accepted
time: 0ms
memory: 2284kb

input:

6 2
5 2

output:

-1

result:

ok correct!

Test #12:

score: 0
Accepted
time: 0ms
memory: 2168kb

input:

5 7
5 5

output:

-1

result:

ok correct!

Test #13:

score: 0
Accepted
time: 0ms
memory: 2224kb

input:

4 7
2 3

output:

-1

result:

ok correct!

Test #14:

score: 0
Accepted
time: 0ms
memory: 2148kb

input:

8 2
2 2

output:

2
0 2 8 2
0 2 4 2

result:

ok correct!

Test #15:

score: 0
Accepted
time: 0ms
memory: 2136kb

input:

3 3
0 2

output:

-1

result:

ok correct!

Test #16:

score: 0
Accepted
time: 0ms
memory: 2144kb

input:

7 7
1 4

output:

-1

result:

ok correct!

Test #17:

score: 0
Accepted
time: 0ms
memory: 2128kb

input:

6 3
6 1

output:

-1

result:

ok correct!

Test #18:

score: 0
Accepted
time: 0ms
memory: 2140kb

input:

4 2
2 1

output:

1
0 0 4 2

result:

ok correct!

Test #19:

score: 0
Accepted
time: 0ms
memory: 2068kb

input:

7 2
3 2

output:

-1

result:

ok correct!

Test #20:

score: 0
Accepted
time: 0ms
memory: 2156kb

input:

2 7
0 3

output:

-1

result:

ok correct!

Test #21:

score: 0
Accepted
time: 0ms
memory: 2220kb

input:

1 7
1 0

output:

0

result:

ok correct!

Test #22:

score: 0
Accepted
time: 0ms
memory: 2232kb

input:

5 1
0 0

output:

0

result:

ok correct!

Test #23:

score: 0
Accepted
time: 0ms
memory: 2284kb

input:

8 7
4 3

output:

-1

result:

ok correct!

Test #24:

score: 0
Accepted
time: 0ms
memory: 2144kb

input:

180057652 674822131
110693180 428023738

output:

-1

result:

ok correct!

Test #25:

score: 0
Accepted
time: 0ms
memory: 2348kb

input:

62347541 812142018
42922107 486416913

output:

-1

result:

ok correct!

Test #26:

score: 0
Accepted
time: 0ms
memory: 2272kb

input:

239604722 244429197
78993837 108804105

output:

-1

result:

ok correct!

Test #27:

score: 0
Accepted
time: 0ms
memory: 2060kb

input:

416861903 381749084
375027630 373683256

output:

-1

result:

ok correct!

Test #28:

score: 0
Accepted
time: 0ms
memory: 2068kb

input:

594119084 519068971
429116021 298715088

output:

-1

result:

ok correct!

Test #29:

score: 0
Accepted
time: 0ms
memory: 2168kb

input:

536870912 536870912
233225286 372408647

output:

29
536870912 0 536870912 536870912
0 536870912 536870912 268435456
536870912 536870912 268435456 402653184
0 0 402653184 469762048
0 0 201326592 234881024
0 0 100663296 117440512
536870912 536870912 50331648 58720256
0 0 293601280 297795584
0 536870912 146800640 148897792
0 0 73400320 342884352
5368...

result:

ok correct!

Test #30:

score: 0
Accepted
time: 0ms
memory: 2124kb

input:

536870912 536870912
242171716 210314503

output:

29
536870912 0 536870912 536870912
536870912 536870912 536870912 268435456
0 536870912 536870912 402653184
0 0 268435456 469762048
0 0 134217728 234881024
0 0 67108864 117440512
536870912 0 33554432 58720256
0 0 285212672 29360128
536870912 536870912 142606336 14680064
536870912 0 339738624 27577548...

result:

ok correct!

Test #31:

score: 0
Accepted
time: 0ms
memory: 2272kb

input:

536870912 536870912
251118145 48220392

output:

29
0 536870912 536870912 536870912
0 536870912 268435456 536870912
0 536870912 134217728 536870912
0 0 67108864 536870912
0 0 33554432 268435456
0 536870912 16777216 134217728
536870912 536870912 8388608 335544320
0 536870912 272629760 436207616
0 0 136314880 486539264
536870912 0 68157440 243269632...

result:

ok correct!

Test #32:

score: 0
Accepted
time: 0ms
memory: 2068kb

input:

126070784 536870912
70206899 483718753

output:

29
126070784 0 126070784 536870912
126070784 0 126070784 268435456
126070784 0 126070784 134217728
126070784 0 126070784 67108864
126070784 0 126070784 33554432
126070784 536870912 126070784 16777216
126070784 536870912 126070784 276824064
126070784 0 126070784 406847488
126070784 0 126070784 203423...

result:

ok correct!

Test #33:

score: 0
Accepted
time: 0ms
memory: 2128kb

input:

134541312 536870912
92168682 321624642

output:

28
134541312 0 134541312 536870912
134541312 0 134541312 268435456
134541312 0 134541312 134217728
134541312 0 134541312 67108864
134541312 0 134541312 33554432
134541312 536870912 134541312 16777216
134541312 0 134541312 276824064
134541312 0 134541312 138412032
134541312 536870912 134541312 692060...

result:

ok correct!

Test #34:

score: 0
Accepted
time: 0ms
memory: 2128kb

input:

605171712 536870912
492293004 159530531

output:

29
605171712 0 605171712 536870912
605171712 536870912 605171712 268435456
605171712 0 605171712 402653184
605171712 0 605171712 201326592
605171712 0 605171712 100663296
605171712 536870912 605171712 50331648
605171712 0 605171712 293601280
605171712 0 605171712 146800640
605171712 0 605171712 7340...

result:

ok correct!

Test #35:

score: 0
Accepted
time: 0ms
memory: 2052kb

input:

816447488 872415232
107288296 282864296

output:

23
816447488 0 816447488 872415232
816447488 0 816447488 436207616
816447488 0 816447488 218103808
816447488 872415232 816447488 109051904
816447488 0 816447488 490733568
816447488 872415232 816447488 245366784
816447488 872415232 816447488 558891008
816447488 0 816447488 715653120
816447488 0 81644...

result:

ok correct!

Test #36:

score: 0
Accepted
time: 0ms
memory: 2124kb

input:

465043456 805306368
155625924 290419248

output:

24
465043456 0 465043456 805306368
465043456 0 465043456 402653184
465043456 0 465043456 201326592
465043456 0 465043456 100663296
465043456 0 465043456 50331648
465043456 805306368 465043456 25165824
465043456 805306368 465043456 415236096
0 0 465043456 610271232
465043456 0 232521728 305135616
465...

result:

ok correct!

Test #37:

score: 0
Accepted
time: 0ms
memory: 2272kb

input:

246022144 587202560
78513033 233147565

output:

24
246022144 0 246022144 587202560
246022144 587202560 246022144 293601280
246022144 587202560 246022144 440401920
246022144 587202560 246022144 513802240
246022144 0 246022144 550502400
246022144 587202560 246022144 275251200
246022144 587202560 246022144 431226880
0 587202560 246022144 509214720
0...

result:

ok correct!

Test #38:

score: 0
Accepted
time: 0ms
memory: 2236kb

input:

536870912 699163134
414335415 699163134

output:

29
0 699163134 536870912 699163134
536870912 699163134 268435456 699163134
536870912 699163134 402653184 699163134
0 699163134 469762048 699163134
536870912 699163134 234881024 699163134
536870912 699163134 385875968 699163134
0 699163134 461373440 699163134
536870912 699163134 230686720 699163134
5...

result:

ok correct!

Test #39:

score: 0
Accepted
time: 0ms
memory: 2148kb

input:

536870912 292943687
423281845 292943687

output:

29
0 292943687 536870912 292943687
0 292943687 268435456 292943687
536870912 292943687 134217728 292943687
0 292943687 335544320 292943687
536870912 292943687 167772160 292943687
536870912 292943687 352321536 292943687
0 292943687 444596224 292943687
536870912 292943687 222298112 292943687
0 2929436...

result:

ok correct!

Test #40:

score: 0
Accepted
time: 0ms
memory: 2000kb

input:

536870912 31948433
432228266 0

output:

28
0 0 536870912 0
0 0 268435456 0
536870912 0 134217728 0
0 0 335544320 0
536870912 0 167772160 0
0 0 352321536 0
536870912 0 176160768 0
536870912 0 356515840 0
536870912 0 446693376 0
536870912 0 491782144 0
0 0 514326528 0
0 0 257163264 0
0 0 128581632 0
536870912 0 64290816 0
0 0 300580864 0
53...

result:

ok correct!

Test #41:

score: 0
Accepted
time: 0ms
memory: 2064kb

input:

603979776 243951872
111389958 152469920

output:

25
0 243951872 603979776 243951872
603979776 243951872 301989888 243951872
0 243951872 452984832 243951872
603979776 243951872 226492416 243951872
0 243951872 415236096 243951872
603979776 243951872 207618048 243951872
0 243951872 405798912 243951872
0 243951872 202899456 243951872
603979776 2439518...

result:

ok correct!

Test #42:

score: 0
Accepted
time: 0ms
memory: 2136kb

input:

603979776 892103744
85336938 585443082

output:

25
0 892103744 603979776 892103744
0 892103744 301989888 892103744
603979776 892103744 150994944 892103744
603979776 892103744 377487360 892103744
0 892103744 490733568 892103744
0 892103744 245366784 892103744
603979776 892103744 122683392 892103744
0 892103744 363331584 892103744
603979776 8921037...

result:

ok correct!

Test #43:

score: 0
Accepted
time: 0ms
memory: 2148kb

input:

67108864 893081440
6587231 502358310

output:

26
0 893081440 67108864 893081440
67108864 893081440 33554432 893081440
67108864 893081440 50331648 893081440
67108864 893081440 58720256 893081440
67108864 893081440 62914560 893081440
0 893081440 65011712 893081440
67108864 893081440 32505856 893081440
0 893081440 49807360 893081440
67108864 89308...

result:

ok correct!

Test #44:

score: 0
Accepted
time: 0ms
memory: 2344kb

input:

536870912 536870912
233225286 536870912

output:

28
0 536870912 536870912 536870912
536870912 536870912 268435456 536870912
0 536870912 402653184 536870912
0 536870912 201326592 536870912
0 536870912 100663296 536870912
536870912 536870912 50331648 536870912
0 536870912 293601280 536870912
0 536870912 146800640 536870912
0 536870912 73400320 53687...

result:

ok correct!

Test #45:

score: 0
Accepted
time: 0ms
memory: 2128kb

input:

536870912 536870912
242171716 536870912

output:

27
0 536870912 536870912 536870912
0 536870912 268435456 536870912
0 536870912 134217728 536870912
0 536870912 67108864 536870912
536870912 536870912 33554432 536870912
0 536870912 285212672 536870912
536870912 536870912 142606336 536870912
536870912 536870912 339738624 536870912
536870912 536870912...

result:

ok correct!

Test #46:

score: 0
Accepted
time: 0ms
memory: 2096kb

input:

536870912 536870912
536870912 48220392

output:

26
536870912 0 536870912 536870912
536870912 0 536870912 268435456
536870912 536870912 536870912 134217728
536870912 536870912 536870912 335544320
536870912 536870912 536870912 436207616
536870912 0 536870912 486539264
536870912 0 536870912 243269632
536870912 0 536870912 121634816
536870912 5368709...

result:

ok correct!

Test #47:

score: 0
Accepted
time: 0ms
memory: 2012kb

input:

126070784 536870912
70206899 0

output:

12
0 0 126070784 0
0 0 63035392 0
0 0 31517696 0
126070784 0 15758848 0
0 0 70914816 0
126070784 0 35457408 0
126070784 0 80764096 0
126070784 0 103417440 0
0 0 114744112 0
0 0 57372056 0
0 0 28686028 0
126070784 0 14343014 0

result:

ok correct!

Test #48:

score: 0
Accepted
time: 0ms
memory: 2056kb

input:

536870912 536870912
33554432 1835008

output:

11
536870912 0 536870912 536870912
536870912 536870912 536870912 268435456
536870912 536870912 536870912 402653184
536870912 0 536870912 469762048
536870912 0 536870912 234881024
536870912 0 536870912 117440512
536870912 0 536870912 58720256
0 0 536870912 29360128
0 0 268435456 14680064
0 0 13421772...

result:

ok correct!

Test #49:

score: 0
Accepted
time: 0ms
memory: 2136kb

input:

134541312 536870912
0 321624642

output:

28
0 0 0 536870912
0 0 0 268435456
0 0 0 134217728
0 0 0 67108864
0 0 0 33554432
0 536870912 0 16777216
0 0 0 276824064
0 0 0 138412032
0 536870912 0 69206016
0 0 0 303038464
0 536870912 0 151519232
0 536870912 0 344195072
0 0 0 440532992
0 0 0 220266496
0 536870912 0 110133248
0 536870912 0 3235020...

result:

ok correct!

Test #50:

score: 0
Accepted
time: 0ms
memory: 2144kb

input:

605171712 536870912
605171712 159530531

output:

29
605171712 0 605171712 536870912
605171712 536870912 605171712 268435456
605171712 0 605171712 402653184
605171712 0 605171712 201326592
605171712 0 605171712 100663296
605171712 536870912 605171712 50331648
605171712 0 605171712 293601280
605171712 0 605171712 146800640
605171712 0 605171712 7340...

result:

ok correct!

Test #51:

score: 0
Accepted
time: 0ms
memory: 2228kb

input:

816447488 872415232
107288296 872415232

output:

14
0 872415232 816447488 872415232
0 872415232 408223744 872415232
0 872415232 204111872 872415232
816447488 872415232 102055936 872415232
0 872415232 459251712 872415232
816447488 872415232 229625856 872415232
816447488 872415232 523036672 872415232
0 872415232 669742080 872415232
0 872415232 33487...

result:

ok correct!

Test #52:

score: 0
Accepted
time: 0ms
memory: 2072kb

input:

465043456 805306368
155625924 805306368

output:

17
0 805306368 465043456 805306368
465043456 805306368 232521728 805306368
465043456 805306368 348782592 805306368
0 805306368 406913024 805306368
465043456 805306368 203456512 805306368
0 805306368 334249984 805306368
465043456 805306368 167124992 805306368
0 805306368 316084224 805306368
465043456...

result:

ok correct!

Test #53:

score: 0
Accepted
time: 0ms
memory: 2108kb

input:

246022144 587202560
0 233147565

output:

24
0 0 0 587202560
0 587202560 0 293601280
0 587202560 0 440401920
0 587202560 0 513802240
0 0 0 550502400
0 587202560 0 275251200
0 587202560 0 431226880
0 587202560 0 509214720
0 0 0 548208640
0 0 0 274104320
0 587202560 0 137052160
0 0 0 362127360
0 0 0 181063680
0 587202560 0 90531840
0 0 0 3388...

result:

ok correct!

Test #54:

score: 0
Accepted
time: 0ms
memory: 2204kb

input:

536870912 699163134
0 699163134

output:

0

result:

ok correct!

Test #55:

score: 0
Accepted
time: 0ms
memory: 2132kb

input:

536870912 292943687
423281845 0

output:

29
0 0 536870912 0
0 0 268435456 0
536870912 0 134217728 0
0 0 335544320 0
536870912 0 167772160 0
536870912 0 352321536 0
0 0 444596224 0
536870912 0 222298112 0
0 0 379584512 0
0 0 189792256 0
536870912 0 94896128 0
0 0 315883520 0
0 0 157941760 0
0 0 78970880 0
536870912 0 39485440 0
536870912 0 ...

result:

ok correct!

Test #56:

score: 0
Accepted
time: 0ms
memory: 2284kb

input:

536870912 31948433
0 0

output:

0

result:

ok correct!

Test #57:

score: 0
Accepted
time: 0ms
memory: 2232kb

input:

603979776 243951872
603979776 152469920

output:

3
603979776 0 603979776 243951872
603979776 0 603979776 121975936
603979776 243951872 603979776 60987968

result:

ok correct!

Test #58:

score: 0
Accepted
time: 0ms
memory: 2036kb

input:

603979776 892103744
603979776 585443082

output:

5
603979776 0 603979776 892103744
603979776 0 603979776 446051872
603979776 892103744 603979776 223025936
603979776 0 603979776 557564840
603979776 892103744 603979776 278782420

result:

ok correct!

Test #59:

score: 0
Accepted
time: 0ms
memory: 2076kb

input:

67108864 893081440
6587231 893081440

output:

26
0 893081440 67108864 893081440
67108864 893081440 33554432 893081440
67108864 893081440 50331648 893081440
67108864 893081440 58720256 893081440
67108864 893081440 62914560 893081440
0 893081440 65011712 893081440
67108864 893081440 32505856 893081440
0 893081440 49807360 893081440
67108864 89308...

result:

ok correct!

Test #60:

score: 0
Accepted
time: 0ms
memory: 2268kb

input:

276307968 0
139739247 0

output:

13
0 0 276307968 0
276307968 0 138153984 0
276307968 0 207230976 0
276307968 0 241769472 0
0 0 259038720 0
276307968 0 129519360 0
0 0 202913664 0
0 0 101456832 0
0 0 50728416 0
0 0 25364208 0
0 0 12682104 0
0 0 6341052 0
276307968 0 3170526 0

result:

ok correct!

Test #61:

score: 0
Accepted
time: 0ms
memory: 2168kb

input:

0 365756416
0 136488936

output:

13
0 0 0 365756416
0 0 0 182878208
0 0 0 91439104
0 0 0 45719552
0 365756416 0 22859776
0 365756416 0 194308096
0 365756416 0 280032256
0 365756416 0 322894336
0 365756416 0 344325376
0 365756416 0 355040896
0 0 0 360398656
0 365756416 0 180199328
0 0 0 272977872

result:

ok correct!

Test #62:

score: 0
Accepted
time: 0ms
memory: 2072kb

input:

0 214958080
0 164104960

output:

12
0 0 0 214958080
0 214958080 0 107479040
0 214958080 0 161218560
0 0 0 188088320
0 214958080 0 94044160
0 214958080 0 154501120
0 0 0 184729600
0 0 0 92364800
0 0 0 46182400
0 0 0 23091200
0 214958080 0 11545600
0 214958080 0 113251840

result:

ok correct!

Test #63:

score: 0
Accepted
time: 0ms
memory: 2108kb

input:

713613312 0
122478066 0

output:

12
0 0 713613312 0
713613312 0 356806656 0
713613312 0 535209984 0
713613312 0 624411648 0
713613312 0 669012480 0
713613312 0 691312896 0
0 0 702463104 0
713613312 0 351231552 0
0 0 532422432 0
713613312 0 266211216 0
0 0 489912264 0
0 0 244956132 0

result:

ok correct!

Test #64:

score: 0
Accepted
time: 0ms
memory: 2156kb

input:

0 122953728
0 4427655

output:

13
0 0 0 122953728
0 122953728 0 61476864
0 122953728 0 92215296
0 0 0 107584512
0 0 0 53792256
0 122953728 0 26896128
0 0 0 74924928
0 0 0 37462464
0 122953728 0 18731232
0 0 0 70842480
0 0 0 35421240
0 0 0 17710620
0 0 0 8855310

result:

ok correct!

Test #65:

score: 0
Accepted
time: 0ms
memory: 2108kb

input:

0 268435456
0 36705241

output:

28
0 0 0 268435456
0 0 0 134217728
0 0 0 67108864
0 268435456 0 33554432
0 268435456 0 150994944
0 0 0 209715200
0 268435456 0 104857600
0 268435456 0 186646528
0 268435456 0 227540992
0 268435456 0 247988224
0 0 0 258211840
0 0 0 129105920
0 268435456 0 64552960
0 0 0 166494208
0 0 0 83247104
0 0 0...

result:

ok correct!

Test #66:

score: 0
Accepted
time: 0ms
memory: 2116kb

input:

0 805306368
0 482227593

output:

28
0 0 0 805306368
0 805306368 0 402653184
0 0 0 603979776
0 0 0 301989888
0 0 0 150994944
0 0 0 75497472
0 0 0 37748736
0 805306368 0 18874368
0 0 0 412090368
0 0 0 206045184
0 805306368 0 103022592
0 805306368 0 454164480
0 805306368 0 629735424
0 805306368 0 717520896
0 0 0 761413632
0 805306368 ...

result:

ok correct!

Test #67:

score: 0
Accepted
time: 0ms
memory: 2264kb

input:

805306368 0
635586921 0

output:

28
0 0 805306368 0
805306368 0 402653184 0
0 0 603979776 0
0 0 301989888 0
0 0 150994944 0
805306368 0 75497472 0
0 0 440401920 0
0 0 220200960 0
805306368 0 110100480 0
805306368 0 457703424 0
0 0 631504896 0
0 0 315752448 0
0 0 157876224 0
0 0 78938112 0
805306368 0 39469056 0
805306368 0 42238771...

result:

ok correct!

Test #68:

score: 0
Accepted
time: 0ms
memory: 2072kb

input:

0 805306368
0 421144629

output:

28
0 0 0 805306368
0 805306368 0 402653184
0 805306368 0 603979776
0 0 0 704643072
0 0 0 352321536
0 805306368 0 176160768
0 805306368 0 490733568
0 0 0 648019968
0 805306368 0 324009984
0 0 0 564658176
0 805306368 0 282329088
0 805306368 0 543817728
0 0 0 674562048
0 0 0 337281024
0 0 0 168640512
0...

result:

ok correct!

Test #69:

score: 0
Accepted
time: 0ms
memory: 2124kb

input:

268435456 0
149676330 0

output:

27
0 0 268435456 0
0 0 134217728 0
268435456 0 67108864 0
0 0 167772160 0
268435456 0 83886080 0
0 0 176160768 0
0 0 88080384 0
268435456 0 44040192 0
0 0 156237824 0
0 0 78118912 0
0 0 39059456 0
0 0 19529728 0
268435456 0 9764864 0
268435456 0 139100160 0
268435456 0 203767808 0
268435456 0 236101...

result:

ok correct!

Extra Test:

score: 0
Extra Test Passed