program Program2; const u : array[1..4] of integer = (0, 5, 3, 1); v : array[1..4] of integer = (0, 7, 6, 5); var a, b, c, d, e, f, x, y, z : integer; begin read(a, b, c, d, e, f); z := f + e + d + (c + 3) div 4; y := 5 * d + u[c mod 4]; if (b > y) then begin z := z + (b - y + 8) div 9; x := ((b - y + 8) div 9 * 9 - (b - y)) * 4 + 11 * e + v[c mod 4]; end else x := (y - b) * 4 + 11 * e + v[c mod 4]; if (a > x) then z := z + (a - x + 35) div 36; writeln(z) end.输入: 4 7 9 20 56 47
输出:1