Note: I want to solving this problem using C programming, No way to accepting C++. Please solve this problem with C programming. Question: Chocolate Thief Problem I gave some chocolates to students for their extraordinary performances. A chocolate is a cube shaped thing, which has length, width and height. All the students got the same amount of chocolates; their dimensions may be different but the volumes are the same. Now some of the students are claiming that there is one chocolate thief among them. So, it's not an easy task for me to find the chocolate thief, so I am asking your help. You are given the names of the students and the dimensions of their chocolates; you have to find the name of the chocolate thief. You can assume that there can be at most one thief and if there is a thief, he took some portion of the chocolate from exactly another student (not students). Input Input starts with an integer T (≤ 100), denoting the number of test cases. Each case starts with a line containing an integer n (2 ≤ n ≤ 100) denoting the number of students. Each of the next n lines contains a name and three integers denoting the length, width and height of his/her current chocolate share. Names are strings containing alphanumeric characters and the length of a name is between 1 and 20. And length, width and height will lie in the range [1, 100]. Output For each case, print the case number first. Then if no thief is found, print no thief. Otherwise print x took chocolate from y where x is the name of the chocolate thief, and y is the name of the person from whom the chocolate was taken. Sample Input Output   2 11 atq 3 4 3 mun 10 4 1 sam1 6 6 1 sam2 18 2 1 mub 1 36 1 tan 1 4 9 sha 4 3 3 di 3 12 1 nab 2 2 9 all 8 4 1 fah 3 2 6 2 ja 10 10 10 em 2 50 10   Case 1: mun took chocolate from all Case 2: no thief

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Note: I want to solving this problem using C programming, No way to accepting C++. Please solve this problem with C programming.

Question: Chocolate Thief Problem

I gave some chocolates to students for their extraordinary performances. A chocolate is a cube shaped thing, which has length, width and height. All the students got the same amount of chocolates; their dimensions may be different but the volumes are the same.

Now some of the students are claiming that there is one chocolate thief among them. So, it's not an easy task for me to find the chocolate thief, so I am asking your help.

You are given the names of the students and the dimensions of their chocolates; you have to find the name of the chocolate thief. You can assume that there can be at most one thief and if there is a thief, he took some portion of the chocolate from exactly another student (not students).

Input

Input starts with an integer T (≤ 100), denoting the number of test cases.

Each case starts with a line containing an integer n (2 ≤ n ≤ 100) denoting the number of students. Each of the next n lines contains a name and three integers denoting the length, width and height of his/her current chocolate share. Names are strings containing alphanumeric characters and the length of a name is between 1 and 20. And length, width and height will lie in the range [1, 100].

Output

For each case, print the case number first. Then if no thief is found, print no thief. Otherwise print x took chocolate from y where x is the name of the chocolate thief, and y is the name of the person from whom the chocolate was taken.

Sample

Input Output
 

2

11

atq 3 4 3

mun 10 4 1

sam1 6 6 1

sam2 18 2 1

mub 1 36 1

tan 1 4 9

sha 4 3 3

di 3 12 1

nab 2 2 9

all 8 4 1

fah 3 2 6 2

ja 10 10 10

em 2 50 10

 

Case 1: mun took chocolate from all

Case 2: no thief

 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY