From 90c5361a76ea9d61dd138b9aff119a6ae6d83bb2 Mon Sep 17 00:00:00 2001 From: Filipenko <114gtrap@gmail.com> Date: Mon, 15 May 2023 18:14:48 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=A0=D0=B5=D1=88=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- task_01.py | 5 +++++ task_02.py | 4 ++++ task_03.py | 6 ++++++ task_04.py | 4 ++++ task_05.py | 2 ++ task_06.py | 3 +++ task_07.py | 5 +++++ task_08.py | 6 ++++++ 8 files changed, 35 insertions(+) create mode 100644 task_01.py create mode 100644 task_02.py create mode 100644 task_03.py create mode 100644 task_04.py create mode 100644 task_05.py create mode 100644 task_06.py create mode 100644 task_07.py create mode 100644 task_08.py diff --git a/task_01.py b/task_01.py new file mode 100644 index 0000000..43a4bf7 --- /dev/null +++ b/task_01.py @@ -0,0 +1,5 @@ +a = int(input()) +b = int(input()) +c = int(input()) +sum = a + b + c +print(sum) diff --git a/task_02.py b/task_02.py new file mode 100644 index 0000000..02d4880 --- /dev/null +++ b/task_02.py @@ -0,0 +1,4 @@ +b = int(input()) +h = int(input()) +result = 1/2 * b * h +print(result) diff --git a/task_03.py b/task_03.py new file mode 100644 index 0000000..350fc62 --- /dev/null +++ b/task_03.py @@ -0,0 +1,6 @@ +n = int(input()) # Students +k = int(input()) # Apples +students = int(k / n) +card = int(k % n) +print(students) +print(card) diff --git a/task_04.py b/task_04.py new file mode 100644 index 0000000..af9ee04 --- /dev/null +++ b/task_04.py @@ -0,0 +1,4 @@ +n = int(input()) +hour = n % (60 * 24) // 60 +minutes = n % 60 +print(hour, minutes) diff --git a/task_05.py b/task_05.py new file mode 100644 index 0000000..a3f05c0 --- /dev/null +++ b/task_05.py @@ -0,0 +1,2 @@ +name = input() +print(f"Hello, {name}") diff --git a/task_06.py b/task_06.py new file mode 100644 index 0000000..1ef27df --- /dev/null +++ b/task_06.py @@ -0,0 +1,3 @@ +num = int(input()) +print("The next number for the number " + str(num) + " is " + str(num + 1)) +print("The previous number for the number " + str(num) + " is " + str(num - 1)) diff --git a/task_07.py b/task_07.py new file mode 100644 index 0000000..0092439 --- /dev/null +++ b/task_07.py @@ -0,0 +1,5 @@ +a = int(input()) +b = int(input()) +c = int(input()) +sum = int(a // 2 + b // 2 + c // 2 + a % 2 + b % 2 + c % 2) +print(sum) diff --git a/task_08.py b/task_08.py new file mode 100644 index 0000000..4c5a509 --- /dev/null +++ b/task_08.py @@ -0,0 +1,6 @@ +a = int(input()) +b = int(input()) +l = int(input()) +n = int(input()) +result = (a * n + b*(n-1) + l) * 2 - a +print(result) From 69cadc6797b69caa52a7ed99dcd0d9d39336e087 Mon Sep 17 00:00:00 2001 From: Filipenko <114gtrap@gmail.com> Date: Mon, 15 May 2023 18:23:11 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=97=D0=B0=D0=B4=D0=B0=D1=87=D0=B8=20?= =?UTF-8?q?=D1=80=D0=B5=D1=88=D0=B5=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- task_01.py | 7 ++++--- task_02.py | 11 +++++++---- task_03.py | 16 ++++++++++------ task_04.py | 7 ++++--- task_05.py | 12 ++++++++++-- task_06.py | 12 +++++++++--- task_07.py | 7 +++++-- task_08.py | 16 ++++++++++------ task_09.py | 10 ++++++++++ task_10.py | 10 ++++++++++ task_11.py | 10 ++++++++++ task_12.py | 7 +++++++ task_13.py | 15 +++++++++++++++ 13 files changed, 111 insertions(+), 29 deletions(-) create mode 100644 task_09.py create mode 100644 task_10.py create mode 100644 task_11.py create mode 100644 task_12.py create mode 100644 task_13.py diff --git a/task_01.py b/task_01.py index 43a4bf7..47aafe9 100644 --- a/task_01.py +++ b/task_01.py @@ -1,5 +1,6 @@ a = int(input()) b = int(input()) -c = int(input()) -sum = a + b + c -print(sum) +if a > b: + print(b) +else: + print(a) diff --git a/task_02.py b/task_02.py index 02d4880..1cbf625 100644 --- a/task_02.py +++ b/task_02.py @@ -1,4 +1,7 @@ -b = int(input()) -h = int(input()) -result = 1/2 * b * h -print(result) +num = int(input()) +if num > 0: + print(1) +elif num < 0: + print(-1) +else: + print(0) diff --git a/task_03.py b/task_03.py index 350fc62..64d6d64 100644 --- a/task_03.py +++ b/task_03.py @@ -1,6 +1,10 @@ -n = int(input()) # Students -k = int(input()) # Apples -students = int(k / n) -card = int(k % n) -print(students) -print(card) +a = int(input()) +b = int(input()) +c = int(input()) +d = int(input()) +sq1 = (a+b) % 2 +sq2 = (c+d) % 2 +if sq1 == sq2: + print("YES") +else: + print("NO") diff --git a/task_04.py b/task_04.py index af9ee04..56009d0 100644 --- a/task_04.py +++ b/task_04.py @@ -1,4 +1,5 @@ n = int(input()) -hour = n % (60 * 24) // 60 -minutes = n % 60 -print(hour, minutes) +if n % 4 == 0 and not n % 100 == 0 or n % 400 == 0: + print("YES") +else: + print("NO") diff --git a/task_05.py b/task_05.py index a3f05c0..eb4979c 100644 --- a/task_05.py +++ b/task_05.py @@ -1,2 +1,10 @@ -name = input() -print(f"Hello, {name}") +a = int(input()) +b = int(input()) +c = int(input()) + +if a <= b and a <= c: + print(a) +elif b <= a and b <= c: + print(b) +else: + print(c) diff --git a/task_06.py b/task_06.py index 1ef27df..7f0da54 100644 --- a/task_06.py +++ b/task_06.py @@ -1,3 +1,9 @@ -num = int(input()) -print("The next number for the number " + str(num) + " is " + str(num + 1)) -print("The previous number for the number " + str(num) + " is " + str(num - 1)) +a = int(input()) +b = int(input()) +c = int(input()) +if a == b and a == c: + print(3) +elif a == b and a != c or b == c and a != b or a == c and b != c: + print(2) +else: + print(0) diff --git a/task_07.py b/task_07.py index 0092439..b355d61 100644 --- a/task_07.py +++ b/task_07.py @@ -1,5 +1,8 @@ a = int(input()) b = int(input()) c = int(input()) -sum = int(a // 2 + b // 2 + c // 2 + a % 2 + b % 2 + c % 2) -print(sum) +d = int(input()) +if a == c or b == d: + print("YES") +else: + print("NO") diff --git a/task_08.py b/task_08.py index 4c5a509..9acd603 100644 --- a/task_08.py +++ b/task_08.py @@ -1,6 +1,10 @@ -a = int(input()) -b = int(input()) -l = int(input()) -n = int(input()) -result = (a * n + b*(n-1) + l) * 2 - a -print(result) +x1 = int(input()) +y1 = int(input()) +x2 = int(input()) +y2 = int(input()) +stepX = (x1-x2) +stepY = (y1 - y2) +if abs(stepX) <= 1 and abs(stepY) <= 1: + print("YES") +else: + print("NO") diff --git a/task_09.py b/task_09.py new file mode 100644 index 0000000..119fa71 --- /dev/null +++ b/task_09.py @@ -0,0 +1,10 @@ +x1 = int(input()) +y1 = int(input()) +x2 = int(input()) +y2 = int(input()) +stepX = (x1-x2) +stepY = (y1 - y2) +if abs(stepX) == abs(stepY): + print('YES') +else: + print('NO') diff --git a/task_10.py b/task_10.py new file mode 100644 index 0000000..bde7929 --- /dev/null +++ b/task_10.py @@ -0,0 +1,10 @@ +x1 = int(input()) +y1 = int(input()) +x2 = int(input()) +y2 = int(input()) +stepX = (x1-x2) +stepY = (y1 - y2) +if abs(stepX) == abs(stepY) or x1 == x2 or y1 == y2: + print('YES') +else: + print('NO') diff --git a/task_11.py b/task_11.py new file mode 100644 index 0000000..1e45582 --- /dev/null +++ b/task_11.py @@ -0,0 +1,10 @@ +x1 = int(input()) +y1 = int(input()) +x2 = int(input()) +y2 = int(input()) +dx = abs(x1 - x2) +dy = abs(y1 - y2) +if dx == 1 and dy == 2 or dx == 2 and dy == 1: + print('YES') +else: + print('NO') diff --git a/task_12.py b/task_12.py new file mode 100644 index 0000000..646bf29 --- /dev/null +++ b/task_12.py @@ -0,0 +1,7 @@ +n = int(input()) +m = int(input()) +k = int(input()) +if k < n * m and ((k % n == 0) or (k % m == 0)): + print('YES') +else: + print('NO') diff --git a/task_13.py b/task_13.py new file mode 100644 index 0000000..8b1c7a7 --- /dev/null +++ b/task_13.py @@ -0,0 +1,15 @@ +n = int(input()) +m = int(input()) +x = int(input()) +y = int(input()) + +if n > m: + n, m = m, n +if x >= n / 2: + x = n - x +if y >= m / 2: + y = m - y +if x < y: + print(x) +else: + print(y)