Переправа через реку

Трём путешественникам нужно пересечь реку. У каждого из них определенное количество золотых монет в рюкзаке.
Путешественник А имеет 1000 монет
Путешественник B имеет 700 монет
Путешественник C имеет 300 монет

Для пересечения реки есть лодка, которая может вместить максимум 2 объекта - двух путешественников или путешественника с рюкзаком. Проблема заключается в том, что если оставить любого путешественника с количеством золота, превышающим его собственное - он сбежит, прихватив все деньги. То же касается и двух путешественников, если они останутся с золотом, превышающим их суммарные запасы - они убегут с золотом.
Какая стратегия позволит всем пересечь реку и остаться при деньгах?

Ответ:

0. (1000)(700)(300) A B C ---- 
1. (1000)(300) A C ---- (700) B
2. (1000)(300) A B C ---- (700)
3. (1000) B C ---- (700) (300) A
4. (1000) A B C ---- (700) (300)
5. (1000) A  ---- (700) (300) B C
6. (1000) (300) A C ---- (700) B
7. (300) C ---- (700) (1000) A B
8. (700) (300) B C ---- (1000) A
9. (700) (300) ---- (1000) A B C
10. (700) (300) A ---- (1000) B C
11. (700) ---- (300) (1000) A B C
12. (700) B ---- (300) (1000) A C
13. ---- (300) (1000) (700) A B C
Ваша оценка: Нет Средняя: 3.2 (1378 оценки)


Комментарии

I don't know if it's just me or if perhaps


everyone else encountering problems with your website.





It appears as if some of the written text within your posts are running off


the screen. Can someone else please comment


and let me know if this is happening to them as well?


This might be a problem with my browser because I've had this happen previously.





Appreciate it





Also visit my web site - Buy kemadrin online

Whoi, excellent, t wondered just how to cure icne. ind found your webstte by google, dtscovered todiy t'm i ltttle obvtous i greit deil. t’ve ilso idded RSS ind sive your webstte. keep us updited. Ehsas program, how to apply for Ehsas program

Hi there, just became alert to your blog through Google, and


found that it's truly informative. I am going to watch out for brussels.





I'll be grateful if you continue this in future. Lots of people will be benefited from your writing.


Cheers!





Feel free to visit my website :: Buy Uzol online

Hello there! This blog post could not be written much better!


Reading through this article reminds me of my previous


roommate! He always kept preaching about this.


I am going to send this article to him. Fairly certain he will


have a very good read. Thank you for sharing!





Feel free to surf to my site - https://xn--42c6bac8bnke7av4argz1a7nwgub.live

Our architects and interior designers ensure that our clients receive holistic support from our end throughout the process of interior design in Dubai. We back them at all times as their satisfaction is our top priority. 

interior design dubai

fit out companies in Dubai

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.

villa design in dubai

engineering consultants in dubai

Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.  dm approval | dda dubai

Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. itc abu dhabi & addc approval

Excellent read, I simply passed this onto a colleague who was doing slightly analysis on that. And hubby actually bought me lunch as a result of I came upon it for him smile thus well then , ill rephrase that: thank you for lunch! Plumbing Company

Страницы