#!/usr/bin/env perl use strict; use warnings; my ($n, $k) = split/ /,<>; print 50 * $n + int(500 * $n / (8 + 2 * $k))