def gradingStudents(grades):
n = len(grades)
for i in range(n):
if grades[i] < 38:
grades[i] += 0
elif grades[i] % 5 == 3:
grades[i] += 2
elif grades[i] % 5 == 4:
grades[i] += 1
return grades
print(gradingStudents([73, 67, 38, 33]))
#https://pt.stackoverflow.com/q/485898/101
ZGVmIGdyYWRpbmdTdHVkZW50cyhncmFkZXMpOgogICAgbiA9IGxlbihncmFkZXMpCiAgICBmb3IgaSBpbiByYW5nZShuKToKICAgICAgICBpZiBncmFkZXNbaV0gPCAzODoKICAgICAgICAgICAgZ3JhZGVzW2ldICs9IDAKICAgICAgICBlbGlmIGdyYWRlc1tpXSAlIDUgPT0gMzoKICAgICAgICAgICAgZ3JhZGVzW2ldICs9IDIKICAgICAgICBlbGlmIGdyYWRlc1tpXSAlIDUgPT0gNDoKICAgICAgICAgICAgZ3JhZGVzW2ldICs9IDEKICAgIHJldHVybiBncmFkZXMKCnByaW50KGdyYWRpbmdTdHVkZW50cyhbNzMsIDY3LCAzOCwgMzNdKSkKCiNodHRwczovL3B0LnN0YWNrb3ZlcmZsb3cuY29tL3EvNDg1ODk4LzEwMQ==