<?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=3353_-_Factori_2</id>
	<title>3353 - Factori 2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=3353_-_Factori_2"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3353_-_Factori_2&amp;action=history"/>
	<updated>2026-05-01T05:42:39Z</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=3353_-_Factori_2&amp;diff=3441&amp;oldid=prev</id>
		<title>Paul Matei at 11:06, 11 April 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3353_-_Factori_2&amp;diff=3441&amp;oldid=prev"/>
		<updated>2023-04-11T11:06:40Z</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:06, 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-l31&quot;&gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&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;     return prod&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;     return prod&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;def &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;validate_input&lt;/del&gt;(a, b):&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;def &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;validare_date&lt;/ins&gt;(a, b):&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;     if a &amp;lt; 1 or a &amp;gt; 10**18 or b &amp;lt; 1 or b &amp;gt; 10**18:&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;     if a &amp;lt; 1 or a &amp;gt; 10**18 or b &amp;lt; 1 or b &amp;gt; 10**18:&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;         return False&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;         return False&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-l38&quot;&gt;Line 38:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&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;if __name__ == &amp;#039;__main__&amp;#039;:&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;if __name__ == &amp;#039;__main__&amp;#039;:&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;     a, b = map(int, input().split())&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;     a, b = map(int, input().split())&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 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;validate_input&lt;/del&gt;(a, b):&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 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;validare_date&lt;/ins&gt;(a, b):&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;        print(&quot;\nDatele de intrare corespund restricțiilor impuse.\n&quot;)&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;         prod1 = desc(a)&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;         prod1 = desc(a)&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;         prod2 = desc(b)&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;         prod2 = desc(b)&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-l49&quot;&gt;Line 49:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 50:&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;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;         print(&amp;quot;Datele de intrare nu corespund restricțiilor impuse.&amp;quot;)&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;         print(&amp;quot;Datele de intrare nu corespund restricțiilor impuse.&amp;quot;)&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;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&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;&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;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 colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l56&quot;&gt;Line 56:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 56:&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Acest program calculează produsul distinctelor prime ale numerelor date ca intrare și afișează numărul mai mare dintre cele două produse calculate. Programul include, de asemenea, o funcție de validare a datelor de intrare, care &lt;/del&gt;verifică dacă &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;cele &lt;/del&gt;două numere sunt în intervalul [1, 10^18]&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Codul &lt;/ins&gt;verifică dacă două numere &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;date &lt;/ins&gt;sunt în intervalul [1, 10^18] și calculează &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;divizorul cel mai mic comun între ele. Pentru a face acest lucru&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se utilizează &lt;/ins&gt;o &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;funcție care găsește factorii &lt;/ins&gt;primi &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ai fiecărui număr &lt;/ins&gt;și apoi calculează &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;produsul &lt;/ins&gt;lor. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dacă datele &lt;/ins&gt;de intrare &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nu corespund restricțiilor impuse&lt;/ins&gt;, programul &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;afișează un mesaj &lt;/ins&gt;de &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;eroare. Altfel&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;programul afișează divizorul cel mai mic comun &lt;/ins&gt;și &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;numărul corespunzător cu &lt;/ins&gt;cel mai mic &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;divizor&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 desc primește un număr întreg n &lt;/del&gt;și calculează &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;produsul distinctelor prime ale acestuia&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;folosind &lt;/del&gt;o &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;metodă numită Factorizare în factori &lt;/del&gt;primi&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Funcția returnează produsul calculat.&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 principală, se citesc cele două numere de intrare a &lt;/del&gt;și &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;b, iar &lt;/del&gt;apoi &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se &lt;/del&gt;calculează &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;produsele distinctelor &lt;/del&gt;lor &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;prime, folosind funcția desc&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Se compară cele două produse calculate și se afișează numărul mai mare dintre cele două numere &lt;/del&gt;de intrare&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&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 cele din urmă&lt;/del&gt;, programul &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;include o funcție &lt;/del&gt;de &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;validare a datelor de intrare&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;care primește cele două numere de intrare &lt;/del&gt;și &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;returnează False dacă &lt;/del&gt;cel &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;puțin unul dintre ele este &lt;/del&gt;mai mic &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;decât 1 sau mai mare decât 10^18 și True altfel. Această funcție este apelată utilizând clauza if __name__ == &#039;__main__&#039; pentru a asigura că datele de intrare sunt valide înainte de a fi procesate&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=3353_-_Factori_2&amp;diff=2327&amp;oldid=prev</id>
		<title>Paul Matei: Pagină nouă: == Cerinţa == Se dau două numere naturale. Afișați numărul pentru care produsul factorilor primi este mai mare. Dacă cele două numere au același produs al 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 == ; Intra...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=3353_-_Factori_2&amp;diff=2327&amp;oldid=prev"/>
		<updated>2023-04-01T18:18:29Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: == Cerinţa == Se dau două numere naturale. Afișați numărul pentru care produsul factorilor primi este mai mare. Dacă cele două numere au același produs al 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 == ; Intra...&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 produsul factorilor primi este mai mare. Dacă cele două numere au același produs al 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 produsul &amp;#039;&amp;#039;&amp;#039;6&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 produsul &amp;#039;&amp;#039;&amp;#039;26&amp;#039;&amp;#039;&amp;#039;. Rezultatul este &amp;#039;&amp;#039;&amp;#039;26&amp;#039;&amp;#039;&amp;#039;, pentru că are produsul 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;
def desc(n):&lt;br /&gt;
    prod = 1&lt;br /&gt;
    d = 2&lt;br /&gt;
    while n &amp;gt; 1:&lt;br /&gt;
        p = 0&lt;br /&gt;
        while n % d == 0:&lt;br /&gt;
            n //= d&lt;br /&gt;
            p += 1&lt;br /&gt;
        if p:&lt;br /&gt;
            prod *= d&lt;br /&gt;
        d += 1&lt;br /&gt;
        if d * d &amp;gt; n:&lt;br /&gt;
            d = n&lt;br /&gt;
    return prod&lt;br /&gt;
&lt;br /&gt;
def validate_input(a, b):&lt;br /&gt;
    if a &amp;lt; 1 or a &amp;gt; 10**18 or b &amp;lt; 1 or b &amp;gt; 10**18:&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;
    a, b = map(int, input().split())&lt;br /&gt;
    if validate_input(a, b):&lt;br /&gt;
        prod1 = desc(a)&lt;br /&gt;
        prod2 = desc(b)&lt;br /&gt;
        if prod1 &amp;gt; prod2:&lt;br /&gt;
            print(a)&lt;br /&gt;
        elif prod1 == prod2:&lt;br /&gt;
            print(min(a, b))&lt;br /&gt;
        else:&lt;br /&gt;
            print(b)&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;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==Explicație rezolvare==&lt;br /&gt;
Acest program calculează produsul distinctelor prime ale numerelor date ca intrare și afișează numărul mai mare dintre cele două produse calculate. Programul include, de asemenea, o funcție de validare a datelor de intrare, care verifică dacă cele două numere sunt în intervalul [1, 10^18].&lt;br /&gt;
&lt;br /&gt;
Funcția desc primește un număr întreg n și calculează produsul distinctelor prime ale acestuia, folosind o metodă numită Factorizare în factori primi. Funcția returnează produsul calculat.&lt;br /&gt;
&lt;br /&gt;
În funcția principală, se citesc cele două numere de intrare a și b, iar apoi se calculează produsele distinctelor lor prime, folosind funcția desc. Se compară cele două produse calculate și se afișează numărul mai mare dintre cele două numere de intrare.&lt;br /&gt;
&lt;br /&gt;
În cele din urmă, programul include o funcție de validare a datelor de intrare, care primește cele două numere de intrare și returnează False dacă cel puțin unul dintre ele este mai mic decât 1 sau mai mare decât 10^18 și True altfel. Această funcție este apelată utilizând clauza if __name__ == &amp;#039;__main__&amp;#039; pentru a asigura că datele de intrare sunt valide înainte de a fi procesate.&lt;/div&gt;</summary>
		<author><name>Paul Matei</name></author>
	</entry>
</feed>