use std::{io::{Read, BufWriter, Write}, str::{FromStr, SplitWhitespace},cmp::*,num::*,i32::*,i64::*};
fn main() {
let mut ip = "".to_owned();
std::io::stdin().read_to_string(&mut ip);
let mut it = ip.split_whitespace();
macro_rules! inp {($($x:tt)*) => {($(it.next().unwrap().parse::<$x>().ok().unwrap()),*)};}
let mut pw = BufWriter::new(std::io::stdout());
macro_rules! out {($x:tt) => {write!(pw,$x)};}
// Example integer input
let x = inp!(i32);
// Example multiple input types
let (n,m) = inp!(i32 i32);
// Example output, same as regular rust formatting
out!("hello! this is x: {}",x);
}
dXNlIHN0ZDo6e2lvOjp7UmVhZCwgQnVmV3JpdGVyLCBXcml0ZX0sIHN0cjo6e0Zyb21TdHIsIFNwbGl0V2hpdGVzcGFjZX0sY21wOjoqLG51bTo6KixpMzI6OiosaTY0OjoqfTsKCmZuIG1haW4oKSB7CiAgICBsZXQgbXV0IGlwID0gIiIudG9fb3duZWQoKTsKICAgIHN0ZDo6aW86OnN0ZGluKCkucmVhZF90b19zdHJpbmcoJm11dCBpcCk7CiAgICBsZXQgbXV0IGl0ID0gaXAuc3BsaXRfd2hpdGVzcGFjZSgpOwogICAgbWFjcm9fcnVsZXMhIGlucCB7KCQoJHg6dHQpKikgPT4geygkKGl0Lm5leHQoKS51bndyYXAoKS5wYXJzZTo6PCR4PigpLm9rKCkudW53cmFwKCkpLCopfTt9CiAgICBsZXQgbXV0IHB3ID0gQnVmV3JpdGVyOjpuZXcoc3RkOjppbzo6c3Rkb3V0KCkpOwogICAgbWFjcm9fcnVsZXMhIG91dCB7KCR4OnR0KSA9PiB7d3JpdGUhKHB3LCR4KX07fQoKICAgIC8vIEV4YW1wbGUgaW50ZWdlciBpbnB1dAoKICAgIGxldCB4ID0gaW5wIShpMzIpOwoKICAgIC8vIEV4YW1wbGUgbXVsdGlwbGUgaW5wdXQgdHlwZXMKCiAgICBsZXQgKG4sbSkgPSBpbnAhKGkzMiBpMzIpOwoKICAgIC8vIEV4YW1wbGUgb3V0cHV0LCBzYW1lIGFzIHJlZ3VsYXIgcnVzdCBmb3JtYXR0aW5nCgogICAgb3V0ISgiaGVsbG8hIHRoaXMgaXMgeDoge30iLHgpOwoKfQ==
error: no rules expected the token `,`
--> prog.rs:21:32
|
9 | macro_rules! out {($x:tt) => {write!(pw,$x)};}
| ---------------- when calling this macro
...
21 | out!("hello! this is x: {}",x);
| ^ no rules expected this token in macro call
warning: unused imports: `FromStr`, `SplitWhitespace`, `Write`, `cmp::*`, `i32::*`, `i64::*`, `num::*`
--> prog.rs:1:33
|
1 | use std::{io::{Read, BufWriter, Write}, str::{FromStr, SplitWhitespace},cmp::*,num::*,i32::*,i64::*};
| ^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
error: aborting due to previous error; 1 warning emitted