<?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=3352_-_Factori_1</id>
	<title>3352 - Factori 1 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=3352_-_Factori_1"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3352_-_Factori_1&amp;action=history"/>
	<updated>2026-05-01T10:14:54Z</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=3352_-_Factori_1&amp;diff=5754&amp;oldid=prev</id>
		<title>Diana Butuza: /* Exemplu */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3352_-_Factori_1&amp;diff=5754&amp;oldid=prev"/>
		<updated>2023-05-02T12:42:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exemplu&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 12:42, 2 May 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-l11&quot;&gt;Line 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 11:&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;:36 26&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;:36 26&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;; Ieșire&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;; Ieșire&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;: Datele de intrare corespund restricțiilor impuse.&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;: 26&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;: 26&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;&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;== Explicație ==  &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;== Explicație ==  &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;Factorii primi ai lui &amp;#039;&amp;#039;&amp;#039;36&amp;#039;&amp;#039;&amp;#039; sunt &amp;#039;&amp;#039;&amp;#039;2&amp;#039;&amp;#039;&amp;#039; și &amp;#039;&amp;#039;&amp;#039;3&amp;#039;&amp;#039;&amp;#039;, cu suma &amp;#039;&amp;#039;&amp;#039;5&amp;#039;&amp;#039;&amp;#039;. Factorii primi ai lui &amp;#039;&amp;#039;&amp;#039;26&amp;#039;&amp;#039;&amp;#039; sunt &amp;#039;&amp;#039;&amp;#039;2&amp;#039;&amp;#039;&amp;#039; și &amp;#039;&amp;#039;&amp;#039;13&amp;#039;&amp;#039;&amp;#039;, cu suma &amp;#039;&amp;#039;&amp;#039;15&amp;#039;&amp;#039;&amp;#039;. Rezultatul este &amp;#039;&amp;#039;&amp;#039;26&amp;#039;&amp;#039;&amp;#039;, pentru că are suma factorilor primi mai mare.&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;Factorii primi ai lui &amp;#039;&amp;#039;&amp;#039;36&amp;#039;&amp;#039;&amp;#039; sunt &amp;#039;&amp;#039;&amp;#039;2&amp;#039;&amp;#039;&amp;#039; și &amp;#039;&amp;#039;&amp;#039;3&amp;#039;&amp;#039;&amp;#039;, cu suma &amp;#039;&amp;#039;&amp;#039;5&amp;#039;&amp;#039;&amp;#039;. Factorii primi ai lui &amp;#039;&amp;#039;&amp;#039;26&amp;#039;&amp;#039;&amp;#039; sunt &amp;#039;&amp;#039;&amp;#039;2&amp;#039;&amp;#039;&amp;#039; și &amp;#039;&amp;#039;&amp;#039;13&amp;#039;&amp;#039;&amp;#039;, cu suma &amp;#039;&amp;#039;&amp;#039;15&amp;#039;&amp;#039;&amp;#039;. Rezultatul este &amp;#039;&amp;#039;&amp;#039;26&amp;#039;&amp;#039;&amp;#039;, pentru că are suma factorilor primi mai mare.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Diana Butuza</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=3352_-_Factori_1&amp;diff=3440&amp;oldid=prev</id>
		<title>Paul Matei at 11:00, 11 April 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3352_-_Factori_1&amp;diff=3440&amp;oldid=prev"/>
		<updated>2023-04-11T11:00:06Z</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 11:00, 11 April 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-l58&quot;&gt;Line 58:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 58:&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;&amp;lt;/syntaxhighlight&amp;gt;&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;&amp;lt;/syntaxhighlight&amp;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;==Explicație rezolvare==&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;==Explicație rezolvare==&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;Acest &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;cod calculează suma exponentelor primelor divizori ai numerelor date, apoi compară aceste sume și afișează numărul cu suma mai mare sau, în caz &lt;/del&gt;de &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;egalitate, numărul mai mic dintre cele &lt;/del&gt;două numere&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&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;Acest &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;program primește &lt;/ins&gt;de &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;la utilizator &lt;/ins&gt;două numere &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;întregi &lt;/ins&gt;și verifică dacă &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;acestea îndeplinesc anumite condiții&lt;/ins&gt;. Dacă &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;numerele sunt valabile&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;programul afișează &lt;/ins&gt;numărul &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dintre cele două care are suma cifrelor factorilor &lt;/ins&gt;primi &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mai mare&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dacă &lt;/ins&gt;suma &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;este aceeași pentru &lt;/ins&gt;ambele numere&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, programul va afișa &lt;/ins&gt;cel &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mai mic &lt;/ins&gt;dintre cele două numere. Dacă &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;cele două numere &lt;/ins&gt;nu &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sunt valabile&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;programul &lt;/ins&gt;afișează &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;un mesaj &lt;/ins&gt;de &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;eroare&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; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Funcția prim(x) primește un număr întreg x &lt;/del&gt;și &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;calculează suma exponentelor primelor divizori ai lui x. Pentru aceasta, se începe cu divizorul d = 2 și se &lt;/del&gt;verifică dacă &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;d este un divizor al lui x&lt;/del&gt;. Dacă &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;da&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se calculează cât de multe ori d divide x, adunând &lt;/del&gt;numărul &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;de divizori &lt;/del&gt;primi &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;de acest tip la variabila cnt&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Apoi se trece la divizorul următor, incrementându-se d. Acest lucru se repetă până când d depășește radicalul din x sau când x devine 1. În final, se returnează &lt;/del&gt;suma &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;divizorilor primi ai lui x.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;În funcția validate_input(x, y) se verifică dacă &lt;/del&gt;ambele numere &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;primite sunt pozitive și diferite de zero. Dacă &lt;/del&gt;cel &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;puțin una &lt;/del&gt;dintre &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aceste condiții nu este îndeplinită, se returnează False, altfel se returnează True.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;În blocul if __name__ == &#039;__main__&#039;:, se primesc &lt;/del&gt;cele două numere &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;x și y, apoi se verifică dacă sunt valide folosind funcția validate_input(x, y). Dacă da, se afișează mesajul &quot;Datele de intrare corespund restricțiilor impuse.&quot; și se calculează și se afișează numărul dorit conform cerinței folosind funcția prim(x)&lt;/del&gt;. Dacă nu, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se &lt;/del&gt;afișează &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mesajul &quot;Datele &lt;/del&gt;de &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;intrare nu corespund restricțiilor impuse.&quot; fără a face nicio altă acțiune&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Paul Matei</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=3352_-_Factori_1&amp;diff=2325&amp;oldid=prev</id>
		<title>Paul Matei: Pagină nouă: == Cerinţa == Se dau două numere naturale. Afișați numărul pentru care suma factorilor primi distincți este mai mare. Dacă cele două numere au aceași sumă a factorilor primi, afișați-l pe cel mai mic. == Date de intrare == Programul citește de la tastatură două numere naturale. == Date de ieşire == Programul va afișa pe ecran numărul cerut. == Restricții și precizări == *cele două numere citite vor fi mai mici decât &#039;&#039;&#039;1.000.000.000&#039;&#039;&#039; == Exemplu == ; I...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3352_-_Factori_1&amp;diff=2325&amp;oldid=prev"/>
		<updated>2023-04-01T18:00:05Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: == Cerinţa == Se dau două numere naturale. Afișați numărul pentru care suma factorilor primi distincți este mai mare. Dacă cele două numere au aceași sumă a factorilor primi, afișați-l pe cel mai mic. == Date de intrare == Programul citește de la tastatură două numere naturale. == Date de ieşire == Programul va afișa pe ecran numărul cerut. == Restricții și precizări == *cele două numere citite vor fi mai mici decât &amp;#039;&amp;#039;&amp;#039;1.000.000.000&amp;#039;&amp;#039;&amp;#039; == Exemplu == ; I...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Cerinţa ==&lt;br /&gt;
Se dau două numere naturale. Afișați numărul pentru care suma factorilor primi distincți este mai mare. Dacă cele două numere au aceași sumă a factorilor primi, afișați-l pe cel mai mic.&lt;br /&gt;
== Date de intrare ==&lt;br /&gt;
Programul citește de la tastatură două numere naturale.&lt;br /&gt;
== Date de ieşire ==&lt;br /&gt;
Programul va afișa pe ecran numărul cerut.&lt;br /&gt;
== Restricții și precizări ==&lt;br /&gt;
*cele două numere citite vor fi mai mici decât &amp;#039;&amp;#039;&amp;#039;1.000.000.000&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
== Exemplu ==&lt;br /&gt;
; Intrare&lt;br /&gt;
:36 26&lt;br /&gt;
; Ieșire&lt;br /&gt;
: 26&lt;br /&gt;
== Explicație == &lt;br /&gt;
Factorii primi ai lui &amp;#039;&amp;#039;&amp;#039;36&amp;#039;&amp;#039;&amp;#039; sunt &amp;#039;&amp;#039;&amp;#039;2&amp;#039;&amp;#039;&amp;#039; și &amp;#039;&amp;#039;&amp;#039;3&amp;#039;&amp;#039;&amp;#039;, cu suma &amp;#039;&amp;#039;&amp;#039;5&amp;#039;&amp;#039;&amp;#039;. Factorii primi ai lui &amp;#039;&amp;#039;&amp;#039;26&amp;#039;&amp;#039;&amp;#039; sunt &amp;#039;&amp;#039;&amp;#039;2&amp;#039;&amp;#039;&amp;#039; și &amp;#039;&amp;#039;&amp;#039;13&amp;#039;&amp;#039;&amp;#039;, cu suma &amp;#039;&amp;#039;&amp;#039;15&amp;#039;&amp;#039;&amp;#039;. Rezultatul este &amp;#039;&amp;#039;&amp;#039;26&amp;#039;&amp;#039;&amp;#039;, pentru că are suma factorilor primi mai mare.&lt;br /&gt;
== Rezolvare ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import math&lt;br /&gt;
&lt;br /&gt;
def prim(x):&lt;br /&gt;
    d = 2&lt;br /&gt;
    cnt = 0&lt;br /&gt;
    while x &amp;gt; 1:&lt;br /&gt;
        p = 0&lt;br /&gt;
        while x % d == 0:&lt;br /&gt;
            p += 1&lt;br /&gt;
            x //= d&lt;br /&gt;
        if p:&lt;br /&gt;
            cnt += d&lt;br /&gt;
        d += 1&lt;br /&gt;
        if d * d &amp;gt; x:&lt;br /&gt;
            d = x&lt;br /&gt;
    return cnt&lt;br /&gt;
&lt;br /&gt;
def validate_input(x, y):&lt;br /&gt;
    if x &amp;lt; 0 or y &amp;lt; 0:&lt;br /&gt;
        return False&lt;br /&gt;
    if x == 0 and y == 0:&lt;br /&gt;
        return False&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;#039;__main__&amp;#039;:&lt;br /&gt;
    x, y = map(int, input().split())&lt;br /&gt;
    if validate_input(x, y):&lt;br /&gt;
        print(&amp;quot;\nDatele de intrare corespund restricțiilor impuse.\n&amp;quot;)&lt;br /&gt;
        if prim(x) &amp;gt; prim(y):&lt;br /&gt;
            print(x)&lt;br /&gt;
        elif prim(x) &amp;lt; prim(y):&lt;br /&gt;
            print(y)&lt;br /&gt;
        else:&lt;br /&gt;
            print(min(x, y))&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;quot;Datele de intrare nu corespund restricțiilor impuse.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Explicație rezolvare==&lt;br /&gt;
Acest cod calculează suma exponentelor primelor divizori ai numerelor date, apoi compară aceste sume și afișează numărul cu suma mai mare sau, în caz de egalitate, numărul mai mic dintre cele două numere.&lt;br /&gt;
&lt;br /&gt;
Funcția prim(x) primește un număr întreg x și calculează suma exponentelor primelor divizori ai lui x. Pentru aceasta, se începe cu divizorul d = 2 și se verifică dacă d este un divizor al lui x. Dacă da, se calculează cât de multe ori d divide x, adunând numărul de divizori primi de acest tip la variabila cnt. Apoi se trece la divizorul următor, incrementându-se d. Acest lucru se repetă până când d depășește radicalul din x sau când x devine 1. În final, se returnează suma divizorilor primi ai lui x.&lt;br /&gt;
&lt;br /&gt;
În funcția validate_input(x, y) se verifică dacă ambele numere primite sunt pozitive și diferite de zero. Dacă cel puțin una dintre aceste condiții nu este îndeplinită, se returnează False, altfel se returnează True.&lt;br /&gt;
&lt;br /&gt;
În blocul if __name__ == &amp;#039;__main__&amp;#039;:, se primesc cele două numere x și y, apoi se verifică dacă sunt valide folosind funcția validate_input(x, y). Dacă da, se afișează mesajul &amp;quot;Datele de intrare corespund restricțiilor impuse.&amp;quot; și se calculează și se afișează numărul dorit conform cerinței folosind funcția prim(x). Dacă nu, se afișează mesajul &amp;quot;Datele de intrare nu corespund restricțiilor impuse.&amp;quot; fără a face nicio altă acțiune.&lt;/div&gt;</summary>
		<author><name>Paul Matei</name></author>
	</entry>
</feed>