4 persons a, b , c , d have to go to concert which will held
in 17 minutes. there is a bridge which only 2 persons at a
time can cross. its night and they have only one flashlight
with them. Flashlight cannot be thrown. one person should
return with the flashlight

all 4 person have different speed.

a = crosses bridge in 1 min.
b = crosses bridge in 2 min.
c = crosses bridge in 5 min.
d = crosses bridge in 10 min

how can they all reach in time.??

Ex- suppose a and d crosses bridge which will take 10 mins
and then d returns back with a flashlight which will make 20
mins and mission is failed.

Answer Posted / ajit kumar jha

A and B will cross the bridge. --> 2 mins
A will come back with the flashlight. --> 1 min
C and D will cross the bridge --> 10 mins
B will come back with the flashlight. --> 2 mins
A and B will cross the bridge. --> 2 mins

Total is 17 mins.

Is This Answer Correct ?    26 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do you read data area in an rpg program?

1116


Difference Between Skip Before & Space Before?

674


how would you design the process for a nightly, high volume check producing process that needs to select only records that are flagged to be processed?

944


In AS/400 projects in Companies whats the meaning of production support team.what production support involves.also what work does development,maintenance involve what are the other teams or processes that are available for as400 project.

8534


. How to know why the OPM job is in MSGWAIT state?..WHAT COULD BE THE REASON FOR it?

7043






using dfu, user will be able to ___________ from physical file?

579


what is match field indicator?

1027


can you explain the difference between spacea,spaceb,skipa and skipb. I'm new to learning about as400 and printer files. can any one give me an example using source code showing the difference that occurs between using these 4 keywords. A-Physical file PF004 source UNIQUE R RR STUNAM 10 ROLLNU 5 0 MARKS 3 0 SEX 6 K ROLLNU 4 records present in PF004 are STUNAM ROLLNU MARKS SEX KAVYA 12,344 55 FEMALE MADHAVAN 14,579 60 MALE RAMYA 14,785 70 FEMALE KRISHNAN 14,988 72 MALE B-Printer File PRINT1 source A R HEADER A 10 3'STUNAM' A 10 20'ROLLNU' A 10 30'MARKS' A 10 40'SEX' A R DETAIL A SPACEB(1) A STUNAM 10 3 A ROLLNU 5 0 20 A MARKS 3 0 30 A SEX 6 40 A R FOOTER A SPACEB(1) A 20'END OF REPORT' C-RPG/400 Program PRTTPG source FPF004 I F E DISK FPRINT1 O E PRINTER C WRITE HEADER C READ PF004 60 C *IN60 DOWEQ *OFF C WRITE DETAIL C READ PF004 60 C ENDDO C WRITE FOOTER C SETON LR D-spooled file result set Display Spooled File File . . . . . : PRINT1 Page/Line 1/10 Control . . . . . Columns 1 - 130 Find . . . . . . *...+....1....+....2....+....3....+....4....+....5....+.... 6....+....7....+....8....+....9....+....0....+....1....+.... 2....+....3 STUNAM ROLLNU MARKS SEX KAVYA 12344 055 FEMALE MADHAVAN 14579 060 MALE RAMYA 14785 070 FEMALE KRISHNAN 14988 072 MALE END OF REPORT Bottom F3=Exit F12=Cancel F19=Left F20=Right F24=More keys I have changed from SPACEB to SPACEA now in my printer file source E-Changed PRINT1 Source A R HEADER A 10 3'STUNAM' A 10 20'ROLLNU' A 10 30'MARKS' A 10 40'SEX' A R DETAIL A SPACEA(1) A STUNAM 10 3 A ROLLNU 5 0 20 A MARKS 3 0 30 A SEX 6 40 A R FOOTER A SPACEA(1) A 20'END OF REPORT' F-Spooled file Result Set after keyword change Display Spooled File File . . . . . : PRINT1 Page/Line 1/10 Control . . . . . Columns 1 - 130 Find . . . . . . *...+....1....+....2....+....3....+....4....+....5....+.... 6....+....7....+....8....+....9....+....0....+....1....+.... 2....+....3 KAVYAM 12344U 055KS FEMALE MADHAVAN 14579 060 MALE RAMYA 14785 070 FEMALE KRISHNAN 14988 072 MALE END OF REPORT Bottom F3=Exit F12=Cancel F19=Left F20=Right F24=More keys Overprinting not displayed.

10253


define the purpose of the *bcat function?

914


how can I start a page in a new window?

787


A join logical file has how many record formats?

603


what are the various types of device files?

999


How can we arrange duplicate records in a file?

606


What is the difference between iter and do? We know both are used to execute set of statements repeatedly, but what is the main difference?

552


What is the Difference between command attention key and command function key ?

793