<?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=2870_-_Magie</id>
	<title>2870 - Magie - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.universitas.ro/index.php?action=history&amp;feed=atom&amp;title=2870_-_Magie"/>
	<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2870_-_Magie&amp;action=history"/>
	<updated>2026-05-01T06:49: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=2870_-_Magie&amp;diff=6712&amp;oldid=prev</id>
		<title>Pop Giulia at 12:54, 20 May 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2870_-_Magie&amp;diff=6712&amp;oldid=prev"/>
		<updated>2023-05-20T12:54:52Z</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 12:54, 20 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-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 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;Sursa: [https://www.pbinfo.ro/probleme/2870/magie]&lt;/ins&gt;&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;==Enunt==&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;==Enunt==&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;În regatul de gheață Olaf este renumit pentru spectacolele sale de magie. La o reprezentaţie de magie, Olaf invită pe scenă N persoane. Fiecare persoană îi şopteşte lui Olaf la ureche anul nașterii şi el calculează vârsta fiecărei persoane ca fiind diferența dintre 2017 și anul nașterii acesteia.&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;În regatul de gheață Olaf este renumit pentru spectacolele sale de magie. La o reprezentaţie de magie, Olaf invită pe scenă N persoane. Fiecare persoană îi şopteşte lui Olaf la ureche anul nașterii şi el calculează vârsta fiecărei persoane ca fiind diferența dintre 2017 și anul nașterii acesteia.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pop Giulia</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=2870_-_Magie&amp;diff=5620&amp;oldid=prev</id>
		<title>Pop Giulia: /* Solutie */</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2870_-_Magie&amp;diff=5620&amp;oldid=prev"/>
		<updated>2023-04-30T10:27:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Solutie&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 10:27, 30 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-l43&quot;&gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&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;Cel mai mare număr magic este 23. Buchetul cu flori de gheață va conține 23 de flori.&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;Cel mai mare număr magic este 23. Buchetul cu flori de gheață va conține 23 de flori.&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;==Solutie==&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;==Solutie==&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;&amp;lt;syntaxhighlight lang=&quot;python&quot; line&amp;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;n = int(input())&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;n = int(input())&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;max_magic = 0&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;max_magic = 0&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-l56&quot;&gt;Line 56:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 57:&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(num_of_snowmen)&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(num_of_snowmen)&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(max_magic)&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(max_magic)&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;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pop Giulia</name></author>
	</entry>
	<entry>
		<id>https://wiki.universitas.ro/index.php?title=2870_-_Magie&amp;diff=5037&amp;oldid=prev</id>
		<title>Pop Giulia: Pagină nouă: ==Enunt== În regatul de gheață Olaf este renumit pentru spectacolele sale de magie. La o reprezentaţie de magie, Olaf invită pe scenă N persoane. Fiecare persoană îi şopteşte lui Olaf la ureche anul nașterii şi el calculează vârsta fiecărei persoane ca fiind diferența dintre 2017 și anul nașterii acesteia.  Printr-o magie, Olaf face să apară pe scenă, câte un om de zăpadă pentru fiecare copil de 12 ani care se află printre cele N persoane.  Olaf asoci...</title>
		<link rel="alternate" type="text/html" href="https://wiki.universitas.ro/index.php?title=2870_-_Magie&amp;diff=5037&amp;oldid=prev"/>
		<updated>2023-04-27T18:12:41Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: ==Enunt== În regatul de gheață Olaf este renumit pentru spectacolele sale de magie. La o reprezentaţie de magie, Olaf invită pe scenă N persoane. Fiecare persoană îi şopteşte lui Olaf la ureche anul nașterii şi el calculează vârsta fiecărei persoane ca fiind diferența dintre 2017 și anul nașterii acesteia.  Printr-o magie, Olaf face să apară pe scenă, câte un om de zăpadă pentru fiecare copil de 12 ani care se află printre cele N persoane.  Olaf asoci...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Enunt==&lt;br /&gt;
În regatul de gheață Olaf este renumit pentru spectacolele sale de magie. La o reprezentaţie de magie, Olaf invită pe scenă N persoane. Fiecare persoană îi şopteşte lui Olaf la ureche anul nașterii şi el calculează vârsta fiecărei persoane ca fiind diferența dintre 2017 și anul nașterii acesteia.&lt;br /&gt;
&lt;br /&gt;
Printr-o magie, Olaf face să apară pe scenă, câte un om de zăpadă pentru fiecare copil de 12 ani care se află printre cele N persoane.&lt;br /&gt;
&lt;br /&gt;
Olaf asociază apoi pentru fiecare persoană de pe scenă un număr magic obținut prin însumarea tuturor cifrelor ce apar în anul nașterii persoanei respective.&lt;br /&gt;
&lt;br /&gt;
Printr-o nouă magie, Olaf scoate din pălăria sa un buchet cu flori de gheață, buchet ce conține atâtea flori cât arată cel mai mare număr magic asociat de Olaf unei persoane. El dăruieşte acest buchet Elsei – prințesa regatului.&lt;br /&gt;
&lt;br /&gt;
Scrieți un program care să determine:&lt;br /&gt;
&lt;br /&gt;
a) Numărul oamenilor de zăpadă care au apărut pe scenă prin magia lui Olaf;&lt;br /&gt;
b) Numărul florilor de gheață din buchetul pe care Olaf l-a dăruit Elsei.&lt;br /&gt;
&lt;br /&gt;
==Date de intrare==&lt;br /&gt;
Fișierul de intrare magie.in conține pe prima linie numărul N, ce reprezintă numărul persoanelor invitate de Olaf pe scenă, iar de pe următoarele N linii, câte un număr natural care are exact 4 cifre şi care reprezintă anul nașterii unei persoane.&lt;br /&gt;
&lt;br /&gt;
==Date de ieșire==&lt;br /&gt;
Fișierul de ieșire magie.out va conține pe prima linie numărul oamenilor de zăpadă apăruți pe scenă în urma magiei lui Olaf, iar pe cea de-a doua linie, un număr natural ce reprezintă numărul florilor de gheață din buchetul lui Olaf.&lt;br /&gt;
&lt;br /&gt;
==Restricții și precizări==&lt;br /&gt;
1 ≤ N ≤ 100&lt;br /&gt;
==Exemplu:==&lt;br /&gt;
magie.in&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
1994&lt;br /&gt;
2005&lt;br /&gt;
1965&lt;br /&gt;
2005&lt;br /&gt;
2005&lt;br /&gt;
magie.out&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
23&lt;br /&gt;
==Explicație==&lt;br /&gt;
Pe scenă au fost invitate 5 persoane.Trei dintre persoane au vârsta de 12 ani ceea ce înseamnă că Olaf a făcut ca prin magie să apară pe scenă 3 oameni de zăpadă.&lt;br /&gt;
&lt;br /&gt;
Pentru persoana născută în 1994 numărul magic este 1+9+9+4=23.&lt;br /&gt;
Pentru persoana născută în 2005 numărul magic este 2+0+0+5=7&lt;br /&gt;
Pentru persoana născută în 1965 numărul magic este 1+9+6+5=21&lt;br /&gt;
&lt;br /&gt;
Cel mai mare număr magic este 23. Buchetul cu flori de gheață va conține 23 de flori.&lt;br /&gt;
==Solutie==&lt;br /&gt;
n = int(input())&lt;br /&gt;
max_magic = 0&lt;br /&gt;
num_of_snowmen = 0&lt;br /&gt;
for i in range(n):&lt;br /&gt;
year = int(input())&lt;br /&gt;
age = 2017 - year&lt;br /&gt;
if age == 12:&lt;br /&gt;
num_of_snowmen += 1&lt;br /&gt;
magic = sum(int(digit) for digit in str(year))&lt;br /&gt;
if magic &amp;gt; max_magic:&lt;br /&gt;
max_magic = magic&lt;br /&gt;
print(num_of_snowmen)&lt;br /&gt;
print(max_magic)&lt;/div&gt;</summary>
		<author><name>Pop Giulia</name></author>
	</entry>
</feed>