Submission

Status:
PPPPPPPPPP

Score: 100

User: Pera

Problemset: เดินทางไกล

Language: python

Time: 0.024 second

Submitted On: 2025-04-14 18:02:45

def main():
    n, dist = list(map(int, input().split()))
    mt_height: list = []
    for _ in range(n):
        mt_height.append(int(input()))    
        
    mintol: int = dist
    maxtol: int = dist
    
    for h in mt_height:
        if h % 3 == 0 and h % 4 == 0:
            mintol -= h / 3 * 10
            maxtol -= h / 4  * 10
        elif h % 4 == 0:
            mintol -= h / 4 * 10
            maxtol -= h / 4 * 10
        else:
            mintol -= h / 3 * 10
            maxtol -= h / 3 * 10
            
    print(f"{int(mintol)} {int(maxtol)}")
    
main()