Alice has invented a new card game to play with Bob. Alice made a deck of...
Fantastic news! We've located the answer you've been seeking!
Question:
Transcribed Image Text:
Alice has invented a new card game to play with Bob. Alice made a deck of cards with random values between 1 and 52. Bob picks 5 cards. Then, he has to rearrange the cards so that by utilizing the operations plus, minus, or times, the value of the cards reach Alice's favorite number, 42. More precisely, find operations such that ((vall op1 val2) op2 val3) op3 val4) op4 val5) = 42. Help Bob by writing a program to determine whether it is possible to reach 42 given 5 card values. For example, Bob picks 5 cards out of the deck containing 40, 1. 3, 4, and 20. Bob rearranges the cards and supplies four operations, so that 4 * 20  40 + 3 1 = 42. Input: The input consists of five integers on a line, separated by spaces. Each integer is between 1 and 52, inclusive. Output: Print a line containing "YES" if it is possible to reach the value 42 according to the rules of the game, or "NO" otherwise. Test 1 Test Input D 40 1 3 4 20 Expected Output B YES
Expert Answer:
Answer rating: 100% (QA)
Code include using namespace std typedef long long ll int a 5 in... View the full answer
Related Book For
Statistics Data Analysis and Decision Modeling
ISBN: 9780132744287
5th edition
Authors: James R. Evans
Posted Date:
Students also viewed these mathematics questions

Determine whether it is possible that any of the population proportions in Exercise 21 are equal and explain your reasoning. Exercise 21 Construct a 99% confidence interval for the population...

A young entrepreneur has invented a new airadjustable basketball shoe with pump, similar to those advertised widely by more expensive brand names. He contacted a supplier of Victor basketball shoes,...

For each of the following firms, determine whether it is more likely to use job order or process costing. This firm a. Provides legal services. b. Is a healthcare clinic. c. Manufactures shampoo. d....

Determine a house of quality for a ballpoint pen. In the house of quality, fill in three customer requirements. Determine one technical requirement for each customer requirement and fill it in....

Rough Draft of Final Paper In this course, you have looked at classical ethical theories of utilitarianism, deontology, and virtue ethics. You have also examined different perspectives on ethical...

Describe in learning terms the conditions under which family branding is a good policy and those under which it is not.

Who signs change orders?

Hushpuppy Company purchased merchandise on account from a supplier for $6,750, terms 2/10, n/30. Hushpuppy Company returned $1,500 of the merchandise and received full credit. a. If Hushpuppy Company...

In each of the following independent situations, Mario Quinn transfers an asset to a taxable Canadian corporation owned by him and makes an election under Section 85 of the Income Tax Act with...

2 1 Complete client engagement acceptance form. Review correspondence files, prior year audit workpapers, permanent files, financial statements and NA auditor's reports. 3 Apollo Shoes, Inc. AUDIT...

The pNa of a mixture prepared by mixing 100 ml of 0.00053 M of NaCl and 300 ml of 0.00060 M in NaPO, is. O a 3.14 Ob 4.84 Oc 125 Od 2.10 Oe 2.34

To guarantee maximum independence and organizational impact of analytics, it is important that a. The chief data officer (CDO) or chief analytics officer (CAO) reports to the CIO or CFO. b. The CIO...

Discuss and contrast the following locking approaches: primary site 2PL, primary copy 2PL, and distributed 2PL.

Many companies nowadays are investing in analytics. Also, for universities, there are plenty of opportunities to use analytics for streamlining and/or optimizing processes. Examples of applications...

Which of the following statements with regards to random file organization is correct? a. In order to avoid overflow, the hashing algorithm that distributes keys to bucket addresses needs to be...

Which statement is not correct? a. Deadlock prevention can be achieved by static 2PL. b. One approach for deadlock resolution is victim selection, which means choosing and aborting one of the...

Undirected weighted graph 13 4 20 16 6 19 11 14 12 J 17 10 7 18 E 6 1 C 15

What is the difference between the straightline method of depreciation and the written down value method? Which method is more appropriate for reporting earnings?

What are the differences between one and twosample hypothesis tests? Describe the correct mathematical form for specifying the null and alternative hypotheses for both types of tests.

How are standard residuals calculated, and how can they help identify outliers?

Using data in the Excel file Colleges and Universities, find 95% confidence intervals for the standard deviation of the median SAT for each of the two groups: liberal arts colleges and research...

An experiment consists of tossing three fair (not weighted) coins, except that one of the three coins has a head on both sides. Compute the probability of obtaining the indicated results in Problems...

In Problems 6164, a single card is drawn from a standard 52card deck. Calculate the probability of and odds for each event. A face card or a club is drawn.

An experiment consists of tossing three fair (not weighted) coins, except that one of the three coins has a head on both sides. Compute the probability of obtaining the indicated results in Problems...
Question Categories