<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Knapsack on Python Exercises</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/tags/knapsack/</link><description>Recent content in Knapsack on Python Exercises</description><generator>Hugo</generator><language>fa-ir</language><lastBuildDate>Sat, 06 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://amirmahdikahdouii.github.io/Python-Exercises/tags/knapsack/index.xml" rel="self" type="application/rss+xml"/><item><title>خرید کتاب</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/061-max-books-purchase/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/061-max-books-purchase/</guid><description>&lt;p&gt;&lt;strong&gt;#061&lt;/strong&gt; · &lt;strong&gt;Max Books Purchase&lt;/strong&gt; · &lt;code&gt;greedy&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/061-max-books-purchase/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="خرید-کتاب"&gt;خرید کتاب&lt;/h1&gt;
&lt;p&gt;توی این مسئله ما میخوایم که بیشترین تعداد کتابی رو که میتونیم از کتاب فروشی با توجه به بودجه مون بخریم.&lt;/p&gt;
&lt;h1 id="ورودی"&gt;ورودی:&lt;/h1&gt;
&lt;p&gt;در خط اول ورودی، ابتدا n که تعداد کتاب ها و m که مقدار پول ما است، داده میشود.&lt;/p&gt;
&lt;p&gt;در خط دوم ورودی، n عدد که با فاصله از هم جدا داده شده اند داده میشود. تصمین میشود که اعداد طبیعی هستند.&lt;/p&gt;</description></item><item><title>مسئله کوله‌پشتی</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/054-knapsack-max-value/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/054-knapsack-max-value/</guid><description>&lt;p&gt;&lt;strong&gt;#054&lt;/strong&gt; · &lt;strong&gt;Knapsack Max Value&lt;/strong&gt; · &lt;code&gt;dp&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/054-knapsack-max-value/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="مسئله-کوله-پشتی"&gt;مسئله کوله پشتی&lt;/h1&gt;
&lt;p&gt;برنامه ای بنویسید که یک ماتریس n * 2 را از ورودی دریافت کند که ستون اول برابر با وزن اشیا و ستون دوم برابر با ارزش آنها خواهد بود. بعد با توجه به وزن کوله که داده خواهد شد، بیشترین تعداد آیتمی که میتوان در کوله جای داد تا ارزش کلی آنها بیشترین مقدار باشد را خروجی دهید.&lt;/p&gt;</description></item></channel></rss>