Hardware StoreProblem code: CRAFT05 |
Aman has a hardware store in Una. One day when he went down to the store room to fetch a box of nails. He found that the price tag had faded out. The first and the last digits of the price were not readable. Although, the number of nails in the box could be read clearly. The box read,
72 nails, Rs. _679_
What were the two faded digits, and what was the price of one nail?
Aman s friend Arnab has great knowledge of computer programming. So Aman approached him. He wants him write a program that solves the general version of the above problem:
N nails, Rs. _XYZ_
The total number of nails, N, is between 1 and 99, including both. The total price originally consisted of five digits, but we can see only the three digits in the middle. We assume that the first digit is nonzero, that the price of one nail is an integer number of rupees, and that all the nails cost the same price. Given N, X, Y, and Z, write a program that guesses the two faded digits and the original price. In case that there is more than one candidate for the original price, the output should be the most expensive one. That is, the program is to report the two faded digits and the maximum price per nail for the nails
Input
The input consists of T test cases. The number of test cases ( T ) is given on the first line of the input file. The first line of each test case contains an integer N (0 < N < 100), which represents the number of nails. In the following line, there are the three decimal digits X, Y, and Z, separated by a space, of the original price $_XYZ_.
Output
For each test case, your program has to do the following. For a test case, there may be more than one candidate for the original price or there is none. In the latter case your program is to report 0. therwise, if there is more than one candidate for the original price, the program is to report the two faded digits and the maximum price per turkey for the turkeys. The following shows sample input and output for three test cases.
Example
Input: 3 72 6 7 9 5 2 3 7 78 0 0 5 Output: 3 2 511 9 5 18475 0
| Date: | 2010-03-04 |
| Time limit: | 20s |
| Source limit: | 50000 |
| Languages: | C C99 strict C++ 4.0.0-8 C++ 4.3.2 PAS gpc PAS fpc JAVA NICE JAR C# C#2 NEM ST ASM D FORT ADA BASH PERL PYTH RUBY LUA ICON PIKE PHP SCM guile SCM qobi LISP sbcl LISP clisp SCALA HASK ERL CAML CLPS PRLG WSPC BF ICK JS |
Comments

Fetching successful submissions

The test data is incorrect.
The test data is incorrect. This is originally an ACM Problem from seoul regionals and is available at many ACM ICPC online judges for testing. I got my solution accepted at 2 of these and got WA in here.
@Rahul Gulati could you pls
Links: 1.
Links:
1. http://acm.zju.edu.cn:8081/onlinejudge/showProblem.do?problemCode=2679
2. http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=2806
Are you an admin by the way?
no, i'm not. thanks for those
why am i gettign the
why am i gettign the following error:- when i'm tryign submit a cpp code?
You can't submit in this language for this problem. Try link.
@Ankit Same error here as
@Ankit Same error here as well..
& does neone even check these comments?
You might be submitting a cpp
You might be submitting a cpp file by using some otjer compiler
@jaireet Please select the
@jaireet
Please select the approprite compiler as well when u are submitting the solution
hey rahul i my code was
hey rahul i my code was accepted by both the links prvided by you, but here i am getting wrong answere
Hi admin team, I am trying to
Hi admin team, I am trying to submit once after pasting the code in given space, but code is not being run
i.e. neither it is running nor throwing ny kind of errors. This is happeing only for this problem
i am getting this error You
i am getting this error
You can't submit in this language for this problem. Try link.
Same erorr.
Same erorr.
I am also getting same
I am also getting same error.
Admin needs to check it once.
yup..getting same error
yup..getting same error "Can't submit in this language, try link"
@aman : thats not the
@aman : thats not the problem...error persists... but otherwis ei got successful submission in the missile targetting problem...
@admin: any email id or alternate way for submitting the solution??
@lucky :yes me getting the same error...
if wrong complier was the
if wrong complier was the case , it wud show a compile error (still accept the code) here the bug is something else... there has been no recent activity(except for the 7 submissions) in this problem due to the error i guess
I am also getting the same
I am also getting the same error
@Ankit Malpani:Send ur code
@Ankit Malpani:Send ur code at teamcse.nimbus@gmail.com. I'll check it personally but the final submission have to be done at codechef.com only
@Aman - Guess more than two
@Aman - Guess more than two means there is definitely something wrong. Check it out asap.
@Aman You can't submit in
@Aman
You can't submit in this language for this problem. Try link.
I'm getting this error while submitting..............
same error here too..........
same error here too..........
The problem hes been sorted
The problem hes been sorted out.
Sorry for the inconvenience.
made it
made it
Hi ! I'm getting a Runtime
Hi !
I'm getting a Runtime Error (NZEC) in Python and I don't know why. So, what are the main reasons in Python in general ?
Thanks.
@ François Magimel try
@ François Magimel
try int(raw_input()) rather than int(input())
@ Mahesh Chandra Sharma: I'm
@ Mahesh Chandra Sharma:
I'm already using int(raw_input()) but it's not working...
So, this contest is finished.
So, this contest is finished. Can you help me with this runtime error (NZEC) in Python ?
Thanks.