http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/B

Description

Kevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maximum point values of 500, 1000, 1500, 2000, and 2500, respectively. Despite the challenging tasks, Kevin was uncowed and bulldozed through all of them, distinguishing himself from the herd as 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 total 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 are computed as follows: If the maximum point value of a problem is x, and Kevin submitted correctly at minute mbut made w wrong submissions, then his score on that problem is . His total score is equal to the sum of his scores for each problem. In addition, Kevin's total score gets increased by 100 points for each successful hack, but gets decreased by 50 points for each unsuccessful hack.

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

Input

The first line of the input contains five space-separated integers m1m2m3m4m5, where mi (0 ≤ mi ≤ 119) is the time of Kevin's last submission for problem i. His last submission is always correct and gets accepted.

The second line contains five space-separated integers w1w2w3w4w5, where wi (0 ≤ wi ≤ 10) is Kevin's number of wrong submissions on problem i.

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

Output

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

Sample Input

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

Hint

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

简单模拟。

#include<stdio.h>
#include<algorithm>
#define maxx 10
using namespace std;
long long hu,hs;
double x[maxx]={, , , , },w[maxx],score,m[maxx];
int main(){
for(int i=;i<;i++)
scanf("%lf",&m[i]);
for(int i=;i<;i++)
scanf("%lf",&w[i]);
scanf("%lld%lld",&hs,&hu);
for(int i=;i<;i++)
score+=max(0.3*x[i],(-m[i]/)*x[i]-*w[i]);
score+=*hs-*hu;
printf("%.0f\n",score);//.0f实际上是四舍五入,但是题目保证了答案一定是整数
return ;
}

或者

#include<stdio.h>
#include<algorithm>
#define maxx 10
using namespace std;
long long x[maxx]={, , , ,},w[maxx],score,m[maxx],hu,hs;
int main(){
for(int i=;i<;i++)
scanf("%lld",&m[i]);
for(int i=;i<;i++)
scanf("%ldd",&w[i]);
scanf("%lld%lld",&hs,&hu);
for(int i=;i<;i++)
score+=max(x[i]*/,(x[i]-m[i]*x[i]/)-*w[i]);
score+=*hs-*hu;
printf("%lld\n",score);
return ;
}

  

【 CodeForces 604A】B - 特别水的题2-Uncowed Forces的更多相关文章

  1. 【CodeForces 596A】E - 特别水的题5-Wilbur and Swimming Pool

    Description After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the ...

  2. 【CodeForces 599A】D - 特别水的题4- Patrick and Shopping

    Description  meter long road between his house and the first shop and a d2 meter long road between h ...

  3. 【CodeForces 606A】A -特别水的题1-Magic Spheres

    http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/A Description Carl is a beginne ...

  4. 【CodeForces 602A】C - 特别水的题3-Two Bases

    http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/C Description After seeing the ...

  5. Codeforces Round #334 (Div. 2) A. Uncowed Forces 水题

    A. Uncowed Forces Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/604/pro ...

  6. Codeforces Round #378 (Div. 2) D题(data structure)解题报告

    题目地址 先简单的总结一下这次CF,前两道题非常的水,可是第一题又是因为自己想的不够周到而被Hack了一次(或许也应该感谢这个hack我的人,使我没有最后在赛后测试中WA).做到C题时看到题目情况非常 ...

  7. CodeForces.158A Next Round (水模拟)

    CodeForces.158A Next Round (水模拟) 题意分析 校赛水题的英文版,坑点就是要求为正数. 代码总览 #include <iostream> #include &l ...

  8. Codeforces Round #612 (Div. 2) 前四题题解

    这场比赛的出题人挺有意思,全部magic成了青色. 还有题目中的图片特别有趣. 晚上没打,开virtual contest打的,就会前三道,我太菜了. 最后看着题解补了第四道. 比赛传送门 A. An ...

  9. Codeforces 828B Black Square(简单题)

    Codeforces 828B Black Square(简单题) Description Polycarp has a checkered sheet of paper of size n × m. ...

随机推荐

  1. HDU 4964 Emmet --模拟

    题意:给你一个字符串,要求把它按语法转化成HTML格式. 分析:这题其实不难,就是一个递归的事情,当时忽略了括号嵌套的情况,所以一直WA,后来加上这种情况后就过了.简直醉了. 处理id和class时, ...

  2. c查漏补缺

    restrict 要理解什么是restrict,首先要知道Pointer aliasing:指两个或以上的指针指向同一数据,例如: ; int *a = &i; int *b = &i ...

  3. max_allowed_packet自动恢复

    https://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html http://blog.chinaunix.net/uid-20304801 ...

  4. C#中事件的继承

    C#中的子类无法调用父类的事件,可以通过在父类中创建一个方法来调用父类的事件,而子类通过调用父类的方法来触发事件. class parent { protected string name; publ ...

  5. C#文件和文件文件夹按时间、名称排序-顺序与倒序

    对于文件和文件夹有多种排序方式,常用的就是按创建或修改时间.按文件名排序.在 C# 中,按时间和文件名排序都十分简单,用数组提供的排序方法 Array.Sort() 一行代码就可以搞定,当然也可以用常 ...

  6. python 字符编码练习

    通过下面的练习,加深对python字符编码的认识 # \x00 - \xff 256个字符 >>> a = range(256)>>> b = bytes(a) # ...

  7. Android Studio Gradle编译项目报错

    Gradle project sync failed Android Studio每次更新版本都会更新Gradle这个插件,但由于长城的问题每次更新都是失败,又是停止在Refreshing Gradl ...

  8. Android使用service后台更新计划任务

    Service是Android的四大组件之一,这里就不再过多的去描述,下面主要实现启动应用时候利用service后台执行计划任务,退出应用后,关闭service,只存在整个应用的周期中. 首先使用se ...

  9. [MetaHook] R_SparkStreaks

    By hzqst void R_SparkStreaks(vec_t *pos, int count, int velocityMin, int velocityMax) { int i; parti ...

  10. Sea.js & Require.js

    Sea.js 追求简单.自然的代码书写和组织方式,具有以下核心特性: 简单友好的模块定义规范:Sea.js 遵循 CMD 规范,可以像 Node.js 一般书写模块代码. 自然直观的代码组织方式:依赖 ...