英语翻译
Amonggrandfather��spapersabillwasfound:
72turkeys$_679_
Thefirstandthelastdigitsofthenumberthatobviouslyrepresentedthetotalpriceofthoseturkeysarereplacedherebyblanks(denoted_),fortheyarefadedandarenowillegible.Whatarethetwofadeddigitsandwhatwasthepriceofoneturkey?
Wewanttowriteaprogramthatsolvesageneralversionoftheaboveproblem:
Nturkeys$_XYZ_
Thetotalnumberofturkeys,N,isbetween1and99,includingboth.Thetotalpriceoriginallyconsistedoffivedigits,butwecanseeonlythethreedigitsinthemiddle.Weassumethatthefirstdigitisnonzero,thatthepriceofoneturkeyisanintegernumberofdollars,andthatalltheturkeyscostthesameprice.
GivenN,X,Y,andZ,writeaprogramthatguessesthetwofadeddigitsandtheoriginalprice.Incasethatthereismorethanonecandidatefortheoriginalprice,theoutputshouldbethemostexpensiveone.Thatis,theprogramistoreportthetwofadeddigitsandthemaximumpriceperturkeyfortheturkeys.
Input
TheinputconsistsofTtestcases.Thenumberoftestcases(T)isgivenonthefirstlineoftheinputfile.ThefirstlineofeachtestcasecontainsanintegerN(0