Codeforces 604A uncowed Forces

Source: Internet
Author: User

A. Uncowed forces

Kevin Sun has just finished competing in Codeforces Round #334! The round is minutes long and featured five problems with maximum point values of $, $, $, $, and 2500, re Spectively. Despite the challenging tasks, Kevin is uncowed and bulldozed through all of them, distinguishing himself from the herd a s the best cowmputer scientist in all of Bovinia. Kevin knows his submission time for each problem, the number of wrong submissions that he made on each problem, and his to Tal numbers of successful and unsuccessful hacks. Because Codeforces Scoring is complicated, Kevin wants you to write a program to compute his final score.

Codeforces scores was computed as follows:if the maximum point value of a problem is x, and Kevin submitted Correctly at minute m but made w wrong submissions and then he score on this problem is. His total score are equal to the sum of his scores for each problem. In addition, Kevin's total score gets increased by the points for each successful hack, but gets decreased by p Oints for each unsuccessful hack.

All arithmetic operations is performed with absolute precision and no rounding. It's guaranteed that Kevin's final score is an integer.

Input

The first line of the input contains five space-separated integers m 1 , m 2 , m 3 , m 4 , m 5 , where m i (0≤ m i ≤119) is the time of Kevin's last submission for P Roblem i . His last submission was always correct and gets accepted.

The second line contains five space-separated integers w < Span style= "Font-size:small;" >1 , w 2 , Span class= "Tex-span" > w 3 , w 4 , W 5 , where w i (0≤ w i ≤10) is Kevin's number of wrong submissions on Problem i .

The last line contains the space-separated integers hs and hu ( 0≤ Hs, hu ≤20), denoting the Kevin ' s numbers of successful and UNS Uccessful hacks, respectively.

Output

Print A single integer, the value of Kevin ' s final score.

Sample Test (s) Input
20 40 60) 80 100
0 1 2) 3 4
1 0
Output
4900
Input
119 119 119) 119 119
0 0 0) 0 0
10 0
Output
4930
Note

In the second sample, Kevin takes 119 minutes on all of the problems. Therefore, he gets the points on each problem. So he score from solving problems is. Adding in 10 100 = points from hacks, he total, score becomes 3930 + + = 4930.

1#include <cstdio>2#include <iostream>3#include <vector>4#include <cmath>5#include <queue>6#include <string>7#include <map>8#include <cstring>9#include <algorithm>Ten using namespacestd; OnetypedefLong Longll; Atypedef unsignedLong Longull; - structSubmission - { the     intT; -     intwa; -     intSC; -}p[5]; + intMain () - { +     intShack,fhack; A      for(intI=0;i<5; i++) at     { -scanf"%d",&p[i].t); -P[i].sc= -* (i+1); -     } -      for(intI=0;i<5; i++) -scanf"%d",&P[i].wa); inscanf"%d%d",&shack,&fhack); -     intsum=0; to      for(intI=0;i<5; i++) +Sum+=max (0.3*p[i].sc+0.5,(1-p[i].t*1.0/ -) *p[i].sc- -*p[i].wa+0.5); -sum+=shack* -, sum-=fhack* -; theprintf"%d\n", sum); *     return 0; $}

Codeforces 604A uncowed Forces

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.