2022 S1 - Good Fours and Good Fives

Normalimplementationsimple math

1 Solution Available

Solution 1

PYTHON
1# By Oscar Zhou, Abbey Park High School
2# This solution still requires commented explanations. Please feel free to add them!
3
4# https://dmoj.ca/problem/ccc22s1
5
6import sys
7input = sys.stdin.readline
8
9n = int(input())
10
11ans = 0
12
13for i in range(n//5+1):
14    if (n-i*5) % 4 == 0:
15        ans += 1
16
17print(ans)

Test Cases

Select a test case to view input and output