#include using lint=long long; using real=long double; void debug_impl(){std::cerr<<'\n';} templatevoid debug_impl(Head head, Tail... tail){std::cerr << " " << head;debug_impl(tail...);} template::value,std::nullptr_t> = nullptr> std::ostream&operator<<(std::ostream&os,Container const&v) {os<<"{";for(auto it=v.begin();it!=v.end();it++){os<<(it!=v.begin()?",":"")<<*it;}return os<<"}";} templateclass Tuple,class...Args,std::size_t...Inds,std::size_t=std::tuple_size>::value> std::ostream&tuple_output_impl(std::ostream&os,const Tuple&tuple,std::integer_sequence) {os<<"(";(void)std::initializer_list{((void)(os<<(Inds>0?",":"")<(tuple)),0)...};return os<<")";} templateclass Tuple,class...Args,std::size_t=std::tuple_size>::value> std::ostream&operator<<(std::ostream&os,const Tuple&tuple) {return tuple_output_impl(os,tuple,std::index_sequence_for());} #define DEBUG 1 #if DEBUG #define debug(...)do{std::cerr<>p>>q>>a; lint ans=-1; lint inf=1'000'000'000; if(p==q){ ans=a==0?0:inf; }else if(p=q*i/100+a; } ans=inf-dif; }else{ lint l=a==0?0:(a-1)/(p-q)*100; ans=l; for(lint i=l+1;i<=std::min(inf,l+99);i++){ ans+=p*i/100