<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=3685_-_Primest_Prime_Pancakes</id>
	<title>3685 - Primest Prime Pancakes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=3685_-_Primest_Prime_Pancakes"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;action=history"/>
	<updated>2026-05-03T10:36:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;diff=7310&amp;oldid=prev</id>
		<title>Hotico Iulia Denisa: /* Cerință */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;diff=7310&amp;oldid=prev"/>
		<updated>2023-11-13T19:26:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Cerință&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:26, 13 November 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Cerință==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Cerință==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Pentru a câștiga niște bani în plus, Ștefan s-a decis să deschidă un magazin nou de clătite pentru următorul sezon estival, deoarece toată lumea e înnebunită dupa clătite vara. Magazinul va vinde n tipuri de clătite, fiecare dintre ele având un cod anume(două clătite pot avea același cod), în funcție de tipul clătitei.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Pentru a câștiga niște bani în plus, Ștefan s-a decis să deschidă un magazin nou de clătite pentru următorul sezon estival, deoarece toată lumea e înnebunită dupa clătite vara. Magazinul va vinde &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;tipuri de clătite, fiecare dintre ele având un cod anume(două clătite pot avea același cod), în funcție de tipul clătitei.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Pentru a afla prețul unei clătite, Ștefan a găsit un algoritm interesant pentru a decide prețul clătitei. Pentru că numerele prime sunt favoritele sale, prețul va depinde de cât de “primă” este clătita.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Pentru a afla prețul unei clătite, Ștefan a găsit un algoritm interesant pentru a decide prețul clătitei. Pentru că numerele prime sunt favoritele sale, prețul va depinde de cât de “primă” este clătita.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Hotico Iulia Denisa</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;diff=7246&amp;oldid=prev</id>
		<title>Bonte Lucas Gabriel at 18:14, 11 November 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;diff=7246&amp;oldid=prev"/>
		<updated>2023-11-11T18:14:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:14, 11 November 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l142&quot;&gt;Line 142:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 142:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;def verificare_date_intrare(pret_n, coduri, pret_x, pret_p, pret_d):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;def verificare_date_intrare(pret_n, coduri, pret_x, pret_p, pret_d):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     if 1 &amp;lt;= pret_n &amp;lt;= &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;10**5 &lt;/del&gt;and 1 &amp;lt;= pret_x &amp;lt;= &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;10**9 &lt;/del&gt;and 1 &amp;lt;= pret_p &amp;lt;= &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;10**9 &lt;/del&gt;and len(pret_d) == 4:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     if 1 &amp;lt;= pret_n &amp;lt;= &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;100000 &lt;/ins&gt;and 1 &amp;lt;= pret_x &amp;lt;= &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1000000 &lt;/ins&gt;and 1 &amp;lt;= pret_p &amp;lt;= &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1000000 &lt;/ins&gt;and len(pret_d) == 4:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         for code in coduri:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         for code in coduri:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             if 10 &amp;lt;= code &amp;lt;= &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;10**9&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             if 10 &amp;lt;= code &amp;lt;= &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;999999&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                 continue&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                 continue&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             else:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             else:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bonte Lucas Gabriel</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;diff=7231&amp;oldid=prev</id>
		<title>Bonte Lucas Gabriel at 22:51, 10 November 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;diff=7231&amp;oldid=prev"/>
		<updated>2023-11-10T22:51:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;//wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;amp;diff=7231&amp;amp;oldid=7037&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Bonte Lucas Gabriel</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;diff=7037&amp;oldid=prev</id>
		<title>Bonte Lucas Gabriel at 19:36, 24 October 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;diff=7037&amp;oldid=prev"/>
		<updated>2023-10-24T19:36:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:36, 24 October 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Astfel:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Astfel:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Prețul inițial al clătitei e x euro, x fiind dat în datele de intrare.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Prețul inițial al clătitei e &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;x&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;euro, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;x&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;fiind dat în datele de intrare.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dacă codul clătitei e un număr prim, prețul crește cu cod + p euro, unde cod e valoarea codului și p e dat în datele de intrare.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dacă codul clătitei e un număr prim, prețul crește cu &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;cod&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;+ &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;p&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;euro, unde &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;cod&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;e valoarea codului și &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;p&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;e dat în datele de intrare.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Pentru fiecare cifră primă din cod (2, 3, 5, 7), prețul va crește cu d[i] euro, unde valorile d[i] sunt date în datele de intrare.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Pentru fiecare cifră primă din cod &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;(2, 3, 5, 7)&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;, prețul va crește cu &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;d[i]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;euro, unde valorile &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;d[i]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;sunt date în datele de intrare.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dacă suma cifrelor codului este număr prim, prețul crește cu sc euro, unde sc e suma cifrelor codului.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dacă suma cifrelor codului este număr prim, prețul crește cu &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;sc&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;euro, unde &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;sc&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;e suma cifrelor codului.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dacă produsul cifrelor codului este număr prim, prețul crește cu pd euro, unde pd e produsul cifrelor din cod.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dacă produsul cifrelor codului este număr prim, prețul crește cu &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;pd&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;euro, unde &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;pd&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039; &lt;/ins&gt;e produsul cifrelor din cod.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Din păcate, această metodă poate să nu ducă la un profit îndeajuns de mare și acum a venit vremea să îl ajutați pe Ștefan să obțină cel mai mare profit posibil. Pentru a realiza acest obiectiv, puteți să schimbați cel mult o cifră din fiecare cod pentru a maximiza suma prețurilor clătitelor.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Din păcate, această metodă poate să nu ducă la un profit îndeajuns de mare și acum a venit vremea să îl ajutați pe Ștefan să obțină cel mai mare profit posibil. Pentru a realiza acest obiectiv, puteți să schimbați cel mult o cifră din fiecare cod pentru a maximiza suma prețurilor clătitelor.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot;&gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Restricții și precizări==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Restricții și precizări==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*1 ≤ n ≤ 100 000&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;1 ≤ n ≤ 100 000&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*1 ≤ cod[i] ≤ 999 999&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;1 ≤ cod[i] ≤ 999 999&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*1 ≤ x, p, d[i] ≤ 1 000 000&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;1 ≤ x, p, d[i] ≤ 1 000 000&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Pentru teste în valoare de 30 de puncte, 1 ≤ n ≤ 1000.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Pentru teste în valoare de 30 de puncte, 1 ≤ n ≤ 1000.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bonte Lucas Gabriel</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;diff=7036&amp;oldid=prev</id>
		<title>Bonte Lucas Gabriel: Pagină nouă: ==Cerință==  Pentru a câștiga niște bani în plus, Ștefan s-a decis să deschidă un magazin nou de clătite pentru următorul sezon estival, deoarece toată lumea e înnebunită dupa clătite vara. Magazinul va vinde n tipuri de clătite, fiecare dintre ele având un cod anume(două clătite pot avea același cod), în funcție de tipul clătitei.  Pentru a afla prețul unei clătite, Ștefan a găsit un algoritm interesant pentru a decide prețul clătitei. Pentru că...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3685_-_Primest_Prime_Pancakes&amp;diff=7036&amp;oldid=prev"/>
		<updated>2023-10-24T19:32:53Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: ==Cerință==  Pentru a câștiga niște bani în plus, Ștefan s-a decis să deschidă un magazin nou de clătite pentru următorul sezon estival, deoarece toată lumea e înnebunită dupa clătite vara. Magazinul va vinde n tipuri de clătite, fiecare dintre ele având un cod anume(două clătite pot avea același cod), în funcție de tipul clătitei.  Pentru a afla prețul unei clătite, Ștefan a găsit un algoritm interesant pentru a decide prețul clătitei. Pentru că...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Cerință==&lt;br /&gt;
&lt;br /&gt;
Pentru a câștiga niște bani în plus, Ștefan s-a decis să deschidă un magazin nou de clătite pentru următorul sezon estival, deoarece toată lumea e înnebunită dupa clătite vara. Magazinul va vinde n tipuri de clătite, fiecare dintre ele având un cod anume(două clătite pot avea același cod), în funcție de tipul clătitei.&lt;br /&gt;
&lt;br /&gt;
Pentru a afla prețul unei clătite, Ștefan a găsit un algoritm interesant pentru a decide prețul clătitei. Pentru că numerele prime sunt favoritele sale, prețul va depinde de cât de “primă” este clătita.&lt;br /&gt;
&lt;br /&gt;
Astfel:&lt;br /&gt;
&lt;br /&gt;
Prețul inițial al clătitei e x euro, x fiind dat în datele de intrare.&lt;br /&gt;
&lt;br /&gt;
Dacă codul clătitei e un număr prim, prețul crește cu cod + p euro, unde cod e valoarea codului și p e dat în datele de intrare.&lt;br /&gt;
&lt;br /&gt;
Pentru fiecare cifră primă din cod (2, 3, 5, 7), prețul va crește cu d[i] euro, unde valorile d[i] sunt date în datele de intrare.&lt;br /&gt;
&lt;br /&gt;
Dacă suma cifrelor codului este număr prim, prețul crește cu sc euro, unde sc e suma cifrelor codului.&lt;br /&gt;
&lt;br /&gt;
Dacă produsul cifrelor codului este număr prim, prețul crește cu pd euro, unde pd e produsul cifrelor din cod.&lt;br /&gt;
&lt;br /&gt;
Din păcate, această metodă poate să nu ducă la un profit îndeajuns de mare și acum a venit vremea să îl ajutați pe Ștefan să obțină cel mai mare profit posibil. Pentru a realiza acest obiectiv, puteți să schimbați cel mult o cifră din fiecare cod pentru a maximiza suma prețurilor clătitelor.&lt;br /&gt;
&lt;br /&gt;
Totuși, nu puteți face prima cifră egală cu 0 pentru a obține un număr cu o cifră mai puțin, chiar dacă ar putea fi cea mai profitabilă alegere.&lt;br /&gt;
&lt;br /&gt;
==Date de intrare==&lt;br /&gt;
&lt;br /&gt;
Pe prima linie programul va citi numărul n, reprezentând numărul de clătite disponibile în magazinul lui Ștefan.&lt;br /&gt;
&lt;br /&gt;
Pe cea de-a doua linie, programul va citi n numere, reprezentând codurile clătitelor.&lt;br /&gt;
&lt;br /&gt;
Cea de-a treia linie va conține două valori, x și p, cu semnificația din enunț.&lt;br /&gt;
&lt;br /&gt;
Cea de-a patra linie va conține patru valori, d[2] , d[3], d[5], d[7].&lt;br /&gt;
&lt;br /&gt;
==Date de ieșire==&lt;br /&gt;
&lt;br /&gt;
Programul va afișa pe ecran profitul maxim pe care Ștefan îl poate obține după modificarea convenabilă a codurilor clătitelor.&lt;br /&gt;
&lt;br /&gt;
==Restricții și precizări==&lt;br /&gt;
&lt;br /&gt;
*1 ≤ n ≤ 100 000&lt;br /&gt;
*1 ≤ cod[i] ≤ 999 999&lt;br /&gt;
*1 ≤ x, p, d[i] ≤ 1 000 000&lt;br /&gt;
*Pentru teste în valoare de 30 de puncte, 1 ≤ n ≤ 1000.&lt;br /&gt;
&lt;br /&gt;
==Exemplu:==&lt;br /&gt;
&lt;br /&gt;
;Intrare&lt;br /&gt;
:4&lt;br /&gt;
:12 89 941 101&lt;br /&gt;
:5 7&lt;br /&gt;
:8 5 3 9&lt;br /&gt;
;Ieșire&lt;br /&gt;
:1907&lt;br /&gt;
&lt;br /&gt;
==Rezolvare==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot; start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Functie pentru a verifica daca un numar este prim&lt;br /&gt;
def is_prime(n):&lt;br /&gt;
    if n &amp;lt;= 1:&lt;br /&gt;
        return False&lt;br /&gt;
    if n &amp;lt;= 3:&lt;br /&gt;
        return True&lt;br /&gt;
    if n % 2 == 0 or n % 3 == 0:&lt;br /&gt;
        return False&lt;br /&gt;
    i = 5&lt;br /&gt;
    while i * i &amp;lt;= n:&lt;br /&gt;
        if n % i == 0 or n % (i + 2) == 0:&lt;br /&gt;
            return False&lt;br /&gt;
        i += 6&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
# Functie pentru a obtine suma cifrelor unui numar&lt;br /&gt;
def sum_digits(n):&lt;br /&gt;
    return sum(int(digit) for digit in str(n))&lt;br /&gt;
&lt;br /&gt;
# Functie pentru a obtine produsul cifrelor unui numar&lt;br /&gt;
def product_digits(n):&lt;br /&gt;
    product = 1&lt;br /&gt;
    for digit in str(n):&lt;br /&gt;
        product *= int(digit)&lt;br /&gt;
    return product&lt;br /&gt;
&lt;br /&gt;
# Functie pentru a obtine profitul maxim&lt;br /&gt;
def max_profit(n, codes, x, p, d):&lt;br /&gt;
    profit = 0&lt;br /&gt;
    for code in codes:&lt;br /&gt;
        max_price = x&lt;br /&gt;
        # Parcurgem toate cifrele si incercam sa le schimbam cu o alta cifra&lt;br /&gt;
        for i in range(10):&lt;br /&gt;
            for j in range(len(str(code))):&lt;br /&gt;
                # Cream un nou cod prin schimbarea unei cifre&lt;br /&gt;
                new_code = list(str(code))&lt;br /&gt;
                new_code[j] = str(i)&lt;br /&gt;
                new_code = int(&amp;#039;&amp;#039;.join(new_code))&lt;br /&gt;
                price = x&lt;br /&gt;
                # Verificam daca noul cod este prim si adaugam la pret daca este cazul&lt;br /&gt;
                if is_prime(new_code):&lt;br /&gt;
                    price += new_code + p&lt;br /&gt;
                # Adaugam la pret pentru fiecare cifra prima din cod&lt;br /&gt;
                for digit in str(new_code):&lt;br /&gt;
                    if is_prime(int(digit)):&lt;br /&gt;
                        price += d[int(digit)]&lt;br /&gt;
                # Verificam daca suma cifrelor codului este numar prim si adaugam la pret daca este cazul&lt;br /&gt;
                if is_prime(sum_digits(new_code)):&lt;br /&gt;
                    price += sum_digits(new_code)&lt;br /&gt;
                # Verificam daca produsul cifrelor codului este numar prim si adaugam la pret daca este cazul&lt;br /&gt;
                if is_prime(product_digits(new_code)):&lt;br /&gt;
                    price += product_digits(new_code)&lt;br /&gt;
                # Actualizam pretul maxim pentru acest cod de clatita&lt;br /&gt;
                max_price = max(max_price, price)&lt;br /&gt;
        # Adaugam la profit pretul maxim obtinut pentru acest cod de clatita&lt;br /&gt;
        profit += max_price&lt;br /&gt;
    return profit&lt;br /&gt;
&lt;br /&gt;
# Punctul de intrare al programului&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    n = 4&lt;br /&gt;
    codes = [12, 89, 941, 101]&lt;br /&gt;
    x = 5&lt;br /&gt;
    p = 7&lt;br /&gt;
    d = {2:8, 3:5, 5:3, 7:9}&lt;br /&gt;
    &lt;br /&gt;
    print(max_profit(n, codes, x, p, d))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Explicație==&lt;br /&gt;
Trebuie să schimbăm prima valoare de la 12 la 17 și vom obține un profit de 45.&lt;br /&gt;
&lt;br /&gt;
Este optim să păstrăm al doilea cod la 89 pentru un profit de 118.&lt;br /&gt;
&lt;br /&gt;
Trebuie să schimbăm cea de-a treia valoare de la 941 la 991 și vom obține un profit de 1022.&lt;br /&gt;
&lt;br /&gt;
Trebuie să schimbăm cea de-a patra valoare de la 101 la 701 și vom obține un profit de 722.&lt;br /&gt;
&lt;br /&gt;
Suma profiturilor va deveni 1907.&lt;/div&gt;</summary>
		<author><name>Bonte Lucas Gabriel</name></author>
	</entry>
</feed>