subject

Description This programming assignment is to implement a modification of the MAXZONDORCOIN problem on the previous assignment. In this case you have • coins of denominations dı, d2, ..., dn • a target value T where all denominations are distinct and you have 5 coins of each denomination Write code that will determine the maximum number of coins that will add up to the target value T exactly). You may write your program in either Java, Python, C, or C++. 2 Input Format The input will be a text file. The the first line has integers n and m, where n is the number of coins and m is the number of target values T to be tested. After the first line are n lines containing a single integer, the denomination of each coin. These numbers will be distinct. After these there will be m lines of a single integer T, each to be tested against the coin set given in the first n lines. 3 8 3 7 11 = = 3 21 22 72 104 105 106 20 5 127 137 149 157 167 179 191 197 211 227 233 241 257 269 277 283 307 313 331 347 6666 7777 8888 10001 20002 OUTPUT SAMPLES inSample. txt: target: 0, max coins: 0 target: 3, max coins: 1 target: 21, max coins: 3 target: 22, max coins: 6 target: 72, max coins: 12 target: 104, not possible target: 105, max coins: 15 target: 106, not possible inTest1.txt: target: 10000, not possible target: 11000, max coins: 10 target: 11001, not possible target: 11002, max coins: 10 target: 11003, not possible target: 11111, max coins: 11 target: 15000, max coins: 14 target: 16789, max coins: 17 inTest2.txt: target: 6666, max coins: 40 target: 7777, max coins: 45 target: 8888, max coins: 50 target: 10001, max coins: 55 target: 20002, max coins: 90

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 05:00, mikeysoulemison
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
image
Computers and Technology, 23.06.2019 09:30, Princessirisperez0
Given a link with a maximum transmission rate of 32.8 mbps. only two computers, x and y, wish to transmit starting at time t = 0 seconds. computer x sends filex (4 mib) and computer y sends filey (244 kib), both starting at time t = 0. statistical multiplexing is used, with details as follows packet payload size = 1000 bytes packet header size = 24 bytes (overhead) ignore processing and queueing delays assume partial packets (packets consisting of less than 1000 bytes of data) are padded so that they are the same size as full packets. assume continuous alternating-packet transmission. computer x gets the transmission medium first. at what time (t = ? ) would filey finish transmitting? give answer in milliseconds, without units, and round to one decimal places (e. g. for an answer of 0.013777 seconds you would enter "13.8" without the quotes)
Answers: 3
image
Computers and Technology, 23.06.2019 12:50, tommy4260
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
image
Computers and Technology, 23.06.2019 23:40, dudedude1593
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
You know the right answer?
Description This programming assignment is to implement a modification of the MAXZONDORCOIN problem...

Questions in other subjects:

Konu
Mathematics, 17.04.2020 06:29