pub use __cargo_equip::prelude::*; extern crate alloc; use proconio::input; fn main() { input! { n: String, } if n.chars().all(|c| c == '9') { println!("Yes"); } else { println!("No"); } } // The following code was expanded by `cargo-equip`. /// # Bundled libraries /// /// - `once_cell 1.14.0 (registry+https://github.com/rust-lang/crates.io-index)` licensed under `MIT OR Apache-2.0` as `crate::__cargo_equip::crates::__once_cell_1_14_0` /// - `proconio 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)` licensed under `MIT OR Apache-2.0` as `crate::__cargo_equip::crates::proconio` /// /// # License and Copyright Notices /// /// - `once_cell 1.14.0 (registry+https://github.com/rust-lang/crates.io-index)` /// /// ```text /// Permission is hereby granted, free of charge, to any /// person obtaining a copy of this software and associated /// documentation files (the "Software"), to deal in the /// Software without restriction, including without /// limitation the rights to use, copy, modify, merge, /// publish, distribute, sublicense, and/or sell copies of /// the Software, and to permit persons to whom the Software /// is furnished to do so, subject to the following /// conditions: /// /// The above copyright notice and this permission notice /// shall be included in all copies or substantial portions /// of the Software. /// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF /// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED /// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A /// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT /// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY /// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION /// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR /// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER /// DEALINGS IN THE SOFTWARE. /// ``` /// /// - `proconio 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)` /// /// ```text /// The MIT License /// Copyright 2019 (C) statiolake /// /// Permission is hereby granted, free of charge, to any person obtaining a copy of /// this software and associated documentation files (the "Software"), to deal in /// the Software without restriction, including without limitation the rights to /// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of /// the Software, and to permit persons to whom the Software is furnished to do so, /// subject to the following conditions: /// /// The above copyright notice and this permission notice shall be included in all /// copies or substantial portions of the Software. /// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS /// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR /// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER /// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN /// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /// /// Copyright for original `input!` macro is held by Hideyuki Tanaka, 2019. The /// original macro is licensed under BSD 3-clause license. /// /// Redistribution and use in source and binary forms, with or without /// modification, are permitted provided that the following conditions are met: /// /// 1. Redistributions of source code must retain the above copyright notice, this /// list of conditions and the following disclaimer. /// /// 2. Redistributions in binary form must reproduce the above copyright notice, /// this list of conditions and the following disclaimer in the documentation /// and/or other materials provided with the distribution. /// /// 3. Neither the name of the copyright holder nor the names of its contributors /// may be used to endorse or promote products derived from this software /// without specific prior written permission. /// /// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND /// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED /// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE /// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE /// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL /// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR /// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER /// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE /// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /// ``` #[cfg_attr(any(), rustfmt::skip)] #[allow(unused)] mod __cargo_equip { pub(crate) mod crates { pub mod __once_cell_1_14_0 {extern crate alloc;#[path="imp_std.rs"]mod imp{use std::{cell::{Cell,UnsafeCell},hint::unreachable_unchecked,marker::PhantomData,panic::{RefUnwindSafe,UnwindSafe},sync::atomic::{AtomicBool,AtomicPtr,Ordering},thread::{self,Thread},};use crate::__cargo_equip::crates::__once_cell_1_14_0::take_unchecked;#[derive(Debug)]pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)struct OnceCell{queue:AtomicPtr,_marker:PhantomData<*mut Waiter>,value:UnsafeCell>,}unsafe implSync for OnceCell{}unsafe implSend for OnceCell{}implRefUnwindSafe for OnceCell{}implUnwindSafe for OnceCell{}implOnceCell{pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)const fn new()->OnceCell{OnceCell{queue:AtomicPtr::new(INCOMPLETE_PTR),_marker:PhantomData,value:UnsafeCell::new(None),}}pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)const fn with_value(value:T)->OnceCell{OnceCell{queue:AtomicPtr::new(COMPLETE_PTR),_marker:PhantomData,value:UnsafeCell::new(Some(value)),}}#[inline]pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)fn is_initialized(&self)->bool{self.queue.load(Ordering::Acquire)==COMPLETE_PTR}#[cold]pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)fn initialize(&self,f:F)->Result<(),E>where F:FnOnce()->Result,{let mut f=Some(f);let mut res:Result<(),E> =Ok(());let slot:*mut Option =self.value.get();initialize_or_wait(&self.queue,Some(&mut||{let f=unsafe{take_unchecked(&mut f)};match f(){Ok(value)=>{unsafe{*slot=Some(value)};true}Err(err)=>{res=Err(err);false}}}),);res}#[cold]pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)fn wait(&self){initialize_or_wait(&self.queue,None);}pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)unsafe fn get_unchecked(&self)->&T{debug_assert!(self.is_initialized());let slot:&Option =&*self.value.get();match slot{Some(value)=>value,None=>{debug_assert!(false);unreachable_unchecked()}}}pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)fn get_mut(&mut self)->Option<&mut T>{unsafe{&mut*self.value.get()}.as_mut()}#[inline]pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)fn into_inner(self)->Option{self.value.into_inner()}}const INCOMPLETE:usize=0x0;const RUNNING:usize=0x1;const COMPLETE:usize=0x2;const INCOMPLETE_PTR:*mut Waiter=INCOMPLETE as*mut Waiter;const COMPLETE_PTR:*mut Waiter=COMPLETE as*mut Waiter;const STATE_MASK:usize=0x3;#[repr(align(4))]struct Waiter{thread:Cell>,signaled:AtomicBool,next:*mut Waiter,}struct Guard<'a>{queue:&'a AtomicPtr,new_queue:*mut Waiter,}impl Drop for Guard<'_>{fn drop(&mut self){let queue=self.queue.swap(self.new_queue,Ordering::AcqRel);let state=strict::addr(queue)&STATE_MASK;assert_eq!(state,RUNNING);unsafe{let mut waiter=strict::map_addr(queue,|q|q&!STATE_MASK);while!waiter.is_null(){let next=(*waiter).next;let thread=(*waiter).thread.take().unwrap();(*waiter).signaled.store(true,Ordering::Release);waiter=next;thread.unpark();}}}}#[inline(never)]fn initialize_or_wait(queue:&AtomicPtr,mut init:Option<&mut dyn FnMut()->bool>){let mut curr_queue=queue.load(Ordering::Acquire);loop{let curr_state=strict::addr(curr_queue)&STATE_MASK;match(curr_state,&mut init){(COMPLETE,_)=>return,(INCOMPLETE,Some(init))=>{let exchange=queue.compare_exchange(curr_queue,strict::map_addr(curr_queue,|q|(q&!STATE_MASK)|RUNNING),Ordering::Acquire,Ordering::Acquire,);if let Err(new_queue)=exchange{curr_queue=new_queue;continue;}let mut guard=Guard{queue,new_queue:INCOMPLETE_PTR};if init(){guard.new_queue=COMPLETE_PTR;}return;}(INCOMPLETE,None)|(RUNNING,_)=>{wait(&queue,curr_queue);curr_queue=queue.load(Ordering::Acquire);}_=>debug_assert!(false),}}}fn wait(queue:&AtomicPtr,mut curr_queue:*mut Waiter){let curr_state=strict::addr(curr_queue)&STATE_MASK;loop{let node=Waiter{thread:Cell::new(Some(thread::current())),signaled:AtomicBool::new(false),next:strict::map_addr(curr_queue,|q|q&!STATE_MASK),};let me=&node as*const Waiter as*mut Waiter;let exchange=queue.compare_exchange(curr_queue,strict::map_addr(me,|q|q|curr_state),Ordering::Release,Ordering::Relaxed,);if let Err(new_queue)=exchange{if strict::addr(new_queue)&STATE_MASK!=curr_state{return;}curr_queue=new_queue;continue;}while!node.signaled.load(Ordering::Acquire){thread::park();}break;}}mod strict{#[must_use]#[inline]pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)fn addr(ptr:*mut T)->usize where T:Sized,{unsafe{core::mem::transmute(ptr)}}#[must_use]#[inline]pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)fn with_addr(ptr:*mut T,addr:usize)->*mut T where T:Sized,{let self_addr=self::addr(ptr)as isize;let dest_addr=addr as isize;let offset=dest_addr.wrapping_sub(self_addr);(ptr as*mut u8).wrapping_offset(offset)as*mut T}#[must_use]#[inline]pub(in crate::__cargo_equip::crates::__once_cell_1_14_0)fn map_addr(ptr:*mut T,f:impl FnOnce(usize)->usize)->*mut T where T:Sized,{self::with_addr(ptr,f(addr(ptr)))}}}pub mod unsync{use core::{cell::{Cell,UnsafeCell},fmt,hint,mem,ops::{Deref,DerefMut},};use std::panic::{RefUnwindSafe,UnwindSafe};pub struct OnceCell{inner:UnsafeCell>,}implRefUnwindSafe for OnceCell{}implUnwindSafe for OnceCell{}implDefault for OnceCell{fn default()->Self{Self::new()}}implfmt::Debug for OnceCell{fn fmt(&self,f:&mut fmt::Formatter)->fmt::Result{match self.get(){Some(v)=>f.debug_tuple("OnceCell").field(v).finish(),None=>f.write_str("OnceCell(Uninit)"),}}}implClone for OnceCell{fn clone(&self)->OnceCell{match self.get(){Some(value)=>OnceCell::with_value(value.clone()),None=>OnceCell::new(),}}fn clone_from(&mut self,source:&Self){match(self.get_mut(),source.get()){(Some(this),Some(source))=>this.clone_from(source),_=>*self=source.clone(),}}}implPartialEq for OnceCell{fn eq(&self,other:&Self)->bool{self.get()==other.get()}}implEq for OnceCell{}implFromfor OnceCell{fn from(value:T)->Self{OnceCell::with_value(value)}}implOnceCell{pub const fn new()->OnceCell{OnceCell{inner:UnsafeCell::new(None)}}pub const fn with_value(value:T)->OnceCell{OnceCell{inner:UnsafeCell::new(Some(value))}}pub fn get(&self)->Option<&T>{unsafe{&*self.inner.get()}.as_ref()}pub fn get_mut(&mut self)->Option<&mut T>{unsafe{&mut*self.inner.get()}.as_mut()}pub fn set(&self,value:T)->Result<(),T>{match self.try_insert(value){Ok(_)=>Ok(()),Err((_,value))=>Err(value),}}pub fn try_insert(&self,value:T)->Result<&T,(&T,T)>{if let Some(old)=self.get(){return Err((old,value));}let slot=unsafe{&mut*self.inner.get()};*slot=Some(value);Ok(match&*slot{Some(value)=>value,None=>unsafe{hint::unreachable_unchecked()},})}pub fn get_or_init(&self,f:F)->&T where F:FnOnce()->T,{enum Void{}match self.get_or_try_init(||Ok::(f())){Ok(val)=>val,Err(void)=>match void{},}}pub fn get_or_try_init(&self,f:F)->Result<&T,E>where F:FnOnce()->Result,{if let Some(val)=self.get(){return Ok(val);}let val=f()?;assert!(self.set(val).is_ok(),"reentrant init");Ok(self.get().unwrap())}pub fn take(&mut self)->Option{mem::replace(self,Self::default()).into_inner()}pub fn into_inner(self)->Option{self.inner.into_inner()}}pub struct LazyT>{cell:OnceCell,init:Cell>,}implRefUnwindSafe for Lazywhere OnceCell:RefUnwindSafe{}implfmt::Debug for Lazy{fn fmt(&self,f:&mut fmt::Formatter)->fmt::Result{f.debug_struct("Lazy").field("cell",&self.cell).field("init",&"..").finish()}}implLazy{pub const fn new(init:F)->Lazy{Lazy{cell:OnceCell::new(),init:Cell::new(Some(init))}}pub fn into_value(this:Lazy)->Result{let cell=this.cell;let init=this.init;cell.into_inner().ok_or_else(||{init.take().unwrap_or_else(||panic!("Lazy instance has previously been poisoned"))})}}implT>Lazy{pub fn force(this:&Lazy)->&T{this.cell.get_or_init(||match this.init.take(){Some(f)=>f(),None=>panic!("Lazy instance has previously been poisoned"),})}pub fn force_mut(this:&mut Lazy)->&mut T{Self::force(this);Self::get_mut(this).unwrap_or_else(||unreachable!())}pub fn get(this:&Lazy)->Option<&T>{this.cell.get()}pub fn get_mut(this:&mut Lazy)->Option<&mut T>{this.cell.get_mut()}}implT>Deref for Lazy{type Target=T;fn deref(&self)->&T{Lazy::force(self)}}implT>DerefMut for Lazy{fn deref_mut(&mut self)->&mut T{Lazy::force(self);self.cell.get_mut().unwrap_or_else(||unreachable!())}}implDefault for Lazy{fn default()->Lazy{Lazy::new(T::default)}}}pub mod sync{use std::{cell::Cell,fmt,mem,ops::{Deref,DerefMut},panic::RefUnwindSafe,};use crate::__cargo_equip::crates::__once_cell_1_14_0::{imp::OnceCell as Imp,take_unchecked};pub struct OnceCell(Imp);implDefault for OnceCell{fn default()->OnceCell{OnceCell::new()}}implfmt::Debug for OnceCell{fn fmt(&self,f:&mut fmt::Formatter)->fmt::Result{match self.get(){Some(v)=>f.debug_tuple("OnceCell").field(v).finish(),None=>f.write_str("OnceCell(Uninit)"),}}}implClone for OnceCell{fn clone(&self)->OnceCell{match self.get(){Some(value)=>Self::with_value(value.clone()),None=>Self::new(),}}fn clone_from(&mut self,source:&Self){match(self.get_mut(),source.get()){(Some(this),Some(source))=>this.clone_from(source),_=>*self=source.clone(),}}}implFromfor OnceCell{fn from(value:T)->Self{Self::with_value(value)}}implPartialEq for OnceCell{fn eq(&self,other:&OnceCell)->bool{self.get()==other.get()}}implEq for OnceCell{}implOnceCell{pub const fn new()->OnceCell{OnceCell(Imp::new())}pub const fn with_value(value:T)->OnceCell{OnceCell(Imp::with_value(value))}pub fn get(&self)->Option<&T>{if self.0.is_initialized(){Some(unsafe{self.get_unchecked()})}else{None}}pub fn wait(&self)->&T{if!self.0.is_initialized(){self.0.wait()}debug_assert!(self.0.is_initialized());unsafe{self.get_unchecked()}}pub fn get_mut(&mut self)->Option<&mut T>{self.0.get_mut()}pub unsafe fn get_unchecked(&self)->&T{self.0.get_unchecked()}pub fn set(&self,value:T)->Result<(),T>{match self.try_insert(value){Ok(_)=>Ok(()),Err((_,value))=>Err(value),}}pub fn try_insert(&self,value:T)->Result<&T,(&T,T)>{let mut value=Some(value);let res=self.get_or_init(||unsafe{take_unchecked(&mut value)});match value{None=>Ok(res),Some(value)=>Err((res,value)),}}pub fn get_or_init(&self,f:F)->&T where F:FnOnce()->T,{enum Void{}match self.get_or_try_init(||Ok::(f())){Ok(val)=>val,Err(void)=>match void{},}}pub fn get_or_try_init(&self,f:F)->Result<&T,E>where F:FnOnce()->Result,{if let Some(value)=self.get(){return Ok(value);}self.0.initialize(f)?;debug_assert!(self.0.is_initialized());Ok(unsafe{self.get_unchecked()})}pub fn take(&mut self)->Option{mem::replace(self,Self::default()).into_inner()}pub fn into_inner(self)->Option{self.0.into_inner()}}pub struct LazyT>{cell:OnceCell,init:Cell>,}implfmt::Debug for Lazy{fn fmt(&self,f:&mut fmt::Formatter)->fmt::Result{f.debug_struct("Lazy").field("cell",&self.cell).field("init",&"..").finish()}}unsafe implSync for Lazywhere OnceCell:Sync{}implRefUnwindSafe for Lazywhere OnceCell:RefUnwindSafe{}implLazy{pub const fn new(f:F)->Lazy{Lazy{cell:OnceCell::new(),init:Cell::new(Some(f))}}pub fn into_value(this:Lazy)->Result{let cell=this.cell;let init=this.init;cell.into_inner().ok_or_else(||{init.take().unwrap_or_else(||panic!("Lazy instance has previously been poisoned"))})}}implT>Lazy{pub fn force(this:&Lazy)->&T{this.cell.get_or_init(||match this.init.take(){Some(f)=>f(),None=>panic!("Lazy instance has previously been poisoned"),})}pub fn force_mut(this:&mut Lazy)->&mut T{Self::force(this);Self::get_mut(this).unwrap_or_else(||unreachable!())}pub fn get(this:&Lazy)->Option<&T>{this.cell.get()}pub fn get_mut(this:&mut Lazy)->Option<&mut T>{this.cell.get_mut()}}implT>Deref for Lazy{type Target=T;fn deref(&self)->&T{Lazy::force(self)}}implT>DerefMut for Lazy{fn deref_mut(&mut self)->&mut T{Lazy::force(self);self.cell.get_mut().unwrap_or_else(||unreachable!())}}implDefault for Lazy{fn default()->Lazy{Lazy::new(T::default)}}fn _dummy(){}}pub mod race{use core::sync::atomic;use atomic::{AtomicUsize,Ordering};use core::num::NonZeroUsize;#[derive(Default,Debug)]pub struct OnceNonZeroUsize{inner:AtomicUsize,}impl OnceNonZeroUsize{#[inline]pub const fn new()->OnceNonZeroUsize{OnceNonZeroUsize{inner:AtomicUsize::new(0)}}#[inline]pub fn get(&self)->Option{let val=self.inner.load(Ordering::Acquire);NonZeroUsize::new(val)}#[inline]pub fn set(&self,value:NonZeroUsize)->Result<(),()>{let exchange=self.inner.compare_exchange(0,value.get(),Ordering::AcqRel,Ordering::Acquire);match exchange{Ok(_)=>Ok(()),Err(_)=>Err(()),}}pub fn get_or_init(&self,f:F)->NonZeroUsize where F:FnOnce()->NonZeroUsize,{enum Void{}match self.get_or_try_init(||Ok::(f())){Ok(val)=>val,Err(void)=>match void{},}}pub fn get_or_try_init(&self,f:F)->Resultwhere F:FnOnce()->Result,{let val=self.inner.load(Ordering::Acquire);let res=match NonZeroUsize::new(val){Some(it)=>it,None=>{let mut val=f()?.get();let exchange=self.inner.compare_exchange(0,val,Ordering::AcqRel,Ordering::Acquire);if let Err(old)=exchange{val=old;}unsafe{NonZeroUsize::new_unchecked(val)}}};Ok(res)}}#[derive(Default,Debug)]pub struct OnceBool{inner:OnceNonZeroUsize,}impl OnceBool{#[inline]pub const fn new()->OnceBool{OnceBool{inner:OnceNonZeroUsize::new()}}#[inline]pub fn get(&self)->Option{self.inner.get().map(OnceBool::from_usize)}#[inline]pub fn set(&self,value:bool)->Result<(),()>{self.inner.set(OnceBool::to_usize(value))}pub fn get_or_init(&self,f:F)->bool where F:FnOnce()->bool,{OnceBool::from_usize(self.inner.get_or_init(||OnceBool::to_usize(f())))}pub fn get_or_try_init(&self,f:F)->Resultwhere F:FnOnce()->Result,{self.inner.get_or_try_init(||f().map(OnceBool::to_usize)).map(OnceBool::from_usize)}#[inline]fn from_usize(value:NonZeroUsize)->bool{value.get()==1}#[inline]fn to_usize(value:bool)->NonZeroUsize{unsafe{NonZeroUsize::new_unchecked(if value{1}else{2})}}}pub use self::once_box::OnceBox;mod once_box{use super::atomic::{AtomicPtr,Ordering};use core::{marker::PhantomData,ptr};use alloc::boxed::Box;pub struct OnceBox{inner:AtomicPtr,ghost:PhantomData>>,}implcore::fmt::Debug for OnceBox{fn fmt(&self,f:&mut core::fmt::Formatter<'_>)->core::fmt::Result{write!(f,"OnceBox({:?})",self.inner.load(Ordering::Relaxed))}}implDefault for OnceBox{fn default()->Self{Self::new()}}implDrop for OnceBox{fn drop(&mut self){let ptr=*self.inner.get_mut();if!ptr.is_null(){drop(unsafe{Box::from_raw(ptr)})}}}implOnceBox{pub const fn new()->OnceBox{OnceBox{inner:AtomicPtr::new(ptr::null_mut()),ghost:PhantomData}}pub fn get(&self)->Option<&T>{let ptr=self.inner.load(Ordering::Acquire);if ptr.is_null(){return None;}Some(unsafe{&*ptr})}pub fn set(&self,value:Box)->Result<(),Box>{let ptr=Box::into_raw(value);let exchange=self.inner.compare_exchange(ptr::null_mut(),ptr,Ordering::AcqRel,Ordering::Acquire,);if let Err(_)=exchange{let value=unsafe{Box::from_raw(ptr)};return Err(value);}Ok(())}pub fn get_or_init(&self,f:F)->&T where F:FnOnce()->Box,{enum Void{}match self.get_or_try_init(||Ok::,Void>(f())){Ok(val)=>val,Err(void)=>match void{},}}pub fn get_or_try_init(&self,f:F)->Result<&T,E>where F:FnOnce()->Result,E>,{let mut ptr=self.inner.load(Ordering::Acquire);if ptr.is_null(){let val=f()?;ptr=Box::into_raw(val);let exchange=self.inner.compare_exchange(ptr::null_mut(),ptr,Ordering::AcqRel,Ordering::Acquire,);if let Err(old)=exchange{drop(unsafe{Box::from_raw(ptr)});ptr=old;}};Ok(unsafe{&*ptr})}}unsafe implSync for OnceBox{}fn _dummy(){}}}unsafe fn take_unchecked(val:&mut Option)->T{match val.take(){Some(it)=>it,None=>{debug_assert!(false);std::hint::unreachable_unchecked()}}}} pub mod proconio {#![allow(clippy::needless_doctest_main,clippy::print_literal)]use crate::__cargo_equip::preludes::proconio::*;pub use crate::__cargo_equip::macros::proconio::*;pub mod marker{use crate::__cargo_equip::preludes::proconio::*;use crate::__cargo_equip::crates::proconio::source::{Readable,Source};use std::io::BufRead;pub enum Chars{}impl Readable for Chars{type Output=Vec;fn read>(source:&mut S)->Vec{source.next_token_unwrap().chars().collect()}}pub enum Bytes{}impl Readable for Bytes{type Output=Vec;fn read>(source:&mut S)->Vec{source.next_token_unwrap().bytes().collect()}}pub enum Usize1{}impl Readable for Usize1{type Output=usize;fn read>(source:&mut S)->usize{usize::read(source).checked_sub(1).expect("attempted to read the value 0 as a Usize1")}}pub enum Isize1{}impl Readable for Isize1{type Output=isize;fn read>(source:&mut S)->isize{isize::read(source).checked_sub(1).unwrap_or_else(||{panic!(concat!("attempted to read the value {} as a Isize1:"," the value is isize::MIN and cannot be decremented"),std::isize::MIN,)})}}}pub mod source{use crate::__cargo_equip::preludes::proconio::*;use std::any::type_name;use std::fmt::Debug;use std::io::BufRead;use std::str::FromStr;pub mod line{use crate::__cargo_equip::preludes::proconio::*;use super::Source;use crate::__cargo_equip::crates::proconio::source::tokens::Tokens;use std::io::BufRead;pub struct LineSource{tokens:Tokens,reader:R,}implLineSource{pub fn new(reader:R)->LineSource{LineSource{tokens:"".to_owned().into(),reader,}}fn prepare(&mut self){while self.tokens.is_empty(){let mut line=String::new();let num_bytes=self.reader.read_line(&mut line).expect("failed to get linel maybe an IO error.");if num_bytes==0{return;}self.tokens=line.into();}}}implSourcefor LineSource{fn next_token(&mut self)->Option<&str>{self.prepare();self.tokens.next_token()}fn is_empty(&mut self)->bool{self.prepare();self.tokens.is_empty()}}use std::io::BufReader;impl<'a>From<&'a str>for LineSource>{fn from(s:&'a str)->LineSource>{LineSource::new(BufReader::new(s.as_bytes()))}}}pub mod once{use crate::__cargo_equip::preludes::proconio::*;use super::Source;use crate::__cargo_equip::crates::proconio::source::tokens::Tokens;use std::io::BufRead;use std::marker::PhantomData;pub struct OnceSource{tokens:Tokens,_read:PhantomData,}implOnceSource{pub fn new(mut source:R)->OnceSource{let mut context=String::new();source.read_to_string(&mut context).expect("failed to read from source; maybe an IO error.");OnceSource{tokens:context.into(),_read:PhantomData,}}}implSourcefor OnceSource{fn next_token(&mut self)->Option<&str>{self.tokens.next_token()}fn is_empty(&mut self)->bool{self.tokens.is_empty()}}use std::io::BufReader;impl<'a>From<&'a str>for OnceSource>{fn from(s:&'a str)->OnceSource>{OnceSource::new(BufReader::new(s.as_bytes()))}}}mod tokens{use crate::__cargo_equip::preludes::proconio::*;use std::{iter::Peekable,ptr::NonNull,str::SplitWhitespace};pub(super)struct Tokens{tokens:Peekable>,_current_context:CurrentContext,}impl Tokens{pub(super)fn next_token(&mut self)->Option<&str>{self.tokens.next()}pub(super)fn is_empty(&mut self)->bool{self.tokens.peek().is_none()}}impl Fromfor Tokens{fn from(current_context:String)->Self{let current_context=CurrentContext::from(current_context);unsafe{let tokens=current_context.0.as_ref().split_whitespace().peekable();Self{tokens,_current_context:current_context,}}}}unsafe impl Send for Tokens{}unsafe impl Sync for Tokens{}struct CurrentContext(NonNull);impl Fromfor CurrentContext{fn from(s:String)->Self{let s=s.into_boxed_str();Self(NonNull::new(Box::leak(s)).unwrap())}}impl Drop for CurrentContext{fn drop(&mut self){unsafe{Box::from_raw(self.0.as_mut())};}}}pub mod auto{use crate::__cargo_equip::preludes::proconio::*;#[cfg(debug_assertions)]pub use super::line::LineSource as AutoSource;#[cfg(not(debug_assertions))]pub use super::once::OnceSource as AutoSource;}pub trait Source{fn next_token(&mut self)->Option<&str>;#[allow(clippy::wrong_self_convention)]fn is_empty(&mut self)->bool;fn next_token_unwrap(&mut self)->&str{self.next_token().expect(concat!("failed to get the next token; ","maybe reader reached an end of input. ","ensure that arguments for `input!` macro is correctly ","specified to match the problem input."))}}impl>Sourcefor&'_ mut S{fn next_token(&mut self)->Option<&str>{(*self).next_token()}fn is_empty(&mut self)->bool{(*self).is_empty()}}pub trait Readable{type Output;fn read>(source:&mut S)->Self::Output;}implReadable for T where T::Err:Debug,{type Output=T;fn read>(source:&mut S)->T{let token=source.next_token_unwrap();match token.parse(){Ok(v)=>v,Err(e)=>panic!(concat!("failed to parse the input `{input}` ","to the value of type `{ty}`: {err:?}; ","ensure that the input format is collectly specified ","and that the input value must handle specified type.",),input=token,ty=type_name::(),err=e,),}}}}use crate::__cargo_equip::crates::proconio::source::{auto::AutoSource,line::LineSource};use once_cell::sync::OnceCell;use std::io::{BufReader,Stdin};use std::{io::{self,BufRead},sync::Mutex,};pub use crate::__cargo_equip::crates::proconio::source::Readable as __Readable;pub enum StdinSource{Normal(AutoSource),Interactive(LineSource),Unknown(LineSource),}implsource::Sourcefor StdinSource{fn next_token(&mut self)->Option<&str>{match self{StdinSource::Normal(source)=>source.next_token(),StdinSource::Interactive(source)=>source.next_token(),StdinSource::Unknown(source)=>source.next_token(),}}fn is_empty(&mut self)->bool{match self{StdinSource::Normal(source)=>source.is_empty(),StdinSource::Interactive(source)=>source.is_empty(),StdinSource::Unknown(source)=>source.is_empty(),}}}pub static STDIN_SOURCE:OnceCell>>> =OnceCell::new();#[macro_export]macro_rules!__cargo_equip_macro_def_proconio_input{(@from[$source:expr]@rest)=>{};(@from[$source:expr]@rest mut$($rest:tt)*)=>{$crate::__cargo_equip::crates::proconio::input!{@from[$source]@mut[mut]@rest$($rest)*}};(@from[$source:expr]@rest$($rest:tt)*)=>{$crate::__cargo_equip::crates::proconio::input!{@from[$source]@mut[]@rest$($rest)*}};(@from[$source:expr]@mut[$($mut:tt)?]@rest$var:tt:$($rest:tt)*)=>{$crate::__cargo_equip::crates::proconio::input!{@from[$source]@mut[$($mut)*]@var$var@kind[]@rest$($rest)*}};(@from[$source:expr]@mut[$($mut:tt)?]@var$var:tt@kind[$($kind:tt)*]@rest)=>{let$($mut)*$var=$crate::__cargo_equip::crates::proconio::read_value!(@source[$source]@kind[$($kind)*]);};(@from[$source:expr]@mut[$($mut:tt)?]@var$var:tt@kind[$($kind:tt)*]@rest,$($rest:tt)*)=>{$crate::__cargo_equip::crates::proconio::input!(@from[$source]@mut[$($mut)*]@var$var@kind[$($kind)*]@rest);$crate::__cargo_equip::crates::proconio::input!(@from[$source]@rest$($rest)*);};(@from[$source:expr]@mut[$($mut:tt)?]@var$var:tt@kind[$($kind:tt)*]@rest$tt:tt$($rest:tt)*)=>{$crate::__cargo_equip::crates::proconio::input!(@from[$source]@mut[$($mut)*]@var$var@kind[$($kind)*$tt]@rest$($rest)*);};(from$source:expr,$($rest:tt)*)=>{#[allow(unused_variables,unused_mut)]let mut s=$source;$crate::__cargo_equip::crates::proconio::input!{@from[&mut s]@rest$($rest)*}};($($rest:tt)*)=>{let mut locked_stdin=$crate::__cargo_equip::crates::proconio::STDIN_SOURCE.get_or_init(||{std::sync::Mutex::new($crate::__cargo_equip::crates::proconio::StdinSource::Normal($crate::__cargo_equip::crates::proconio::source::auto::AutoSource::new(std::io::BufReader::new(std::io::stdin())),))}).lock().expect(concat!("failed to lock the stdin; please re-run this program. ","If this issue repeatedly occur, this is a bug in `proconio`. ","Please report this issue from ","."));$crate::__cargo_equip::crates::proconio::input!{@from[&mut*locked_stdin]@rest$($rest)*}drop(locked_stdin);};}macro_rules!input{($($tt:tt)*)=>(crate::__cargo_equip_macro_def_proconio_input!{$($tt)*})}#[macro_export]macro_rules!__cargo_equip_macro_def_proconio_input_interactive{($($rest:tt)*)=>{let mut locked_stdin=$crate::__cargo_equip::crates::proconio::STDIN_SOURCE.get_or_init(||{std::sync::Mutex::new($crate::__cargo_equip::crates::proconio::StdinSource::Interactive($crate::__cargo_equip::crates::proconio::source::line::LineSource::new(std::io::BufReader::new(std::io::stdin())),))}).lock().expect(concat!("failed to lock the stdin; please re-run this program. ","If this issue repeatedly occur, this is a bug in `proconio`. ","Please report this issue from ","."));$crate::__cargo_equip::crates::proconio::input!{from&mut*locked_stdin,$($rest)*}drop(locked_stdin);};}macro_rules!input_interactive{($($tt:tt)*)=>(crate::__cargo_equip_macro_def_proconio_input_interactive!{$($tt)*})}#[macro_export]macro_rules!__cargo_equip_macro_def_proconio_read_value{(@source[$source:expr]@kind[[$($kind:tt)*]])=>{$crate::__cargo_equip::crates::proconio::read_value!(@array@source[$source]@kind[]@rest$($kind)*)};(@array@source[$source:expr]@kind[$($kind:tt)*]@rest)=>{{let len=::read($source);$crate::__cargo_equip::crates::proconio::read_value!(@source[$source]@kind[[$($kind)*;len]])}};(@array@source[$source:expr]@kind[$($kind:tt)*]@rest;$($rest:tt)*)=>{$crate::__cargo_equip::crates::proconio::read_value!(@array@source[$source]@kind[$($kind)*]@len[$($rest)*])};(@array@source[$source:expr]@kind[$($kind:tt)*]@rest$tt:tt$($rest:tt)*)=>{$crate::__cargo_equip::crates::proconio::read_value!(@array@source[$source]@kind[$($kind)*$tt]@rest$($rest)*)};(@array@source[$source:expr]@kind[$($kind:tt)*]@len[$($len:tt)*])=>{{let len=$($len)*;(0..len).map(|_|$crate::__cargo_equip::crates::proconio::read_value!(@source[$source]@kind[$($kind)*])).collect::>()}};(@source[$source:expr]@kind[($($kinds:tt)*)])=>{$crate::__cargo_equip::crates::proconio::read_value!(@tuple@source[$source]@kinds[]@current[]@rest$($kinds)*)};(@tuple@source[$source:expr]@kinds[$([$($kind:tt)*])*]@current[]@rest)=>{($($crate::__cargo_equip::crates::proconio::read_value!(@source[$source]@kind[$($kind)*]),)*)};(@tuple@source[$source:expr]@kinds[$($kinds:tt)*]@current[$($curr:tt)*]@rest)=>{$crate::__cargo_equip::crates::proconio::read_value!(@tuple@source[$source]@kinds[$($kinds)*[$($curr)*]]@current[]@rest)};(@tuple@source[$source:expr]@kinds[$($kinds:tt)*]@current[$($curr:tt)*]@rest,$($rest:tt)*)=>{$crate::__cargo_equip::crates::proconio::read_value!(@tuple@source[$source]@kinds[$($kinds)*[$($curr)*]]@current[]@rest$($rest)*)};(@tuple@source[$source:expr]@kinds[$($kinds:tt)*]@current[$($curr:tt)*]@rest$tt:tt$($rest:tt)*)=>{$crate::__cargo_equip::crates::proconio::read_value!(@tuple@source[$source]@kinds[$($kinds)*]@current[$($curr)*$tt]@rest$($rest)*)};(@source[$source:expr]@kind[])=>{compile_error!(concat!("Reached unreachable statement while parsing macro input. ","This is a bug in `proconio`. ","Please report this issue from ","."));};(@source[$source:expr]@kind[$kind:ty])=>{<$kind as$crate::__cargo_equip::crates::proconio::__Readable>::read($source)}}macro_rules!read_value{($($tt:tt)*)=>(crate::__cargo_equip_macro_def_proconio_read_value!{$($tt)*})}pub fn is_stdin_empty()->bool{use source::Source;let mut lock=STDIN_SOURCE.get_or_init(||{Mutex::new(StdinSource::Unknown(LineSource::new(BufReader::new(io::stdin(),))))}).lock().expect(concat!("failed to lock the stdin; please re-run this program. ","If this issue repeatedly occur, this is a bug in `proconio`. ","Please report this issue from ","."));lock.is_empty()}} } pub(crate) mod macros { pub mod __once_cell_1_14_0 {} pub mod proconio {pub use crate::{__cargo_equip_macro_def_proconio_input as input,__cargo_equip_macro_def_proconio_input_interactive as input_interactive,__cargo_equip_macro_def_proconio_read_value as read_value};} } pub(crate) mod prelude {pub use crate::__cargo_equip::crates::*;} mod preludes { pub mod __once_cell_1_14_0 {} pub mod proconio {pub(in crate::__cargo_equip)use crate::__cargo_equip::crates::__once_cell_1_14_0 as once_cell;} } }