Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
357 B
4
Indexable
Never
def get_hash(matr):
    max_elem = max([max(row) for row in matr])
    h = 0
    for i in range(4):
        for j in range(4):
            h += matr[i][j] * 4**(i+1)
    return h % max_elem
    

if __name__ == "__main__":
    matr = []
    for i in range(4):
        matr.append(list(map(int, input().split())))
    print(get_hash(matr))
    
Leave a Comment