This page is still under construction.

Parts of this page are still being built. What you see may change.

Football Scoring

Time limit1sMemory limit1024 MB

Summary
Given each team's touchdowns, field goals, safeties, point-after kicks, and two-point conversions, compute each team's total score.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

There are five ways to score points in American professional football:

  1. Touchdown: 6 points
  2. Field goal: 3 points
  3. Safety: 2 points
  4. After touchdown
    1. 1 point (field goal or safety), typically called the 'Point after'
    2. 2 points (touchdown), typically called the 'Two-point conversion'

(https://operations.nfl.com/the-rules/nfl-video-rulebook/scoring-plays/)

Given the box score for two competing teams, calculate the point total for each team.

Input

There are two lines of input. Each line contains five space-separated non-negative integers T, F, S, P, and C. They are the number of touchdowns, field goals, safeties, point-after-touchdown kicks, and two-point conversions after touchdown. The first line is the box score for the visiting team, and the second line is the box score for the home team.

0≤T≤100 \le T \le 10, 0≤F≤100 \le F \le 10, 0≤S≤100 \le S \le 10, 0≤(P+C)≤T0 \le (P+C) \le T

Output

The output is one line with two space-separated integers: the visiting team's score and the home team's score.

Examples1

  1. Example 1

    Input
    1 3 0 0 1
    3 1 1 1 1
    
    Expected output
    17 26