锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品亚洲,欧美成人高清视频,亚洲国产精品久久久久秋霞不卡http://m.shnenglu.com/vontroy/category/15065.htmlzh-cnSat, 19 Jan 2013 07:58:14 GMTSat, 19 Jan 2013 07:58:14 GMT60HDU 3661 Assignments-2010 Harbin Regionalhttp://m.shnenglu.com/vontroy/archive/2010/10/03/128409.htmlVontroyVontroySun, 03 Oct 2010 00:36:00 GMThttp://m.shnenglu.com/vontroy/archive/2010/10/03/128409.htmlhttp://m.shnenglu.com/vontroy/comments/128409.htmlhttp://m.shnenglu.com/vontroy/archive/2010/10/03/128409.html#Feedback0http://m.shnenglu.com/vontroy/comments/commentRss/128409.htmlhttp://m.shnenglu.com/vontroy/services/trackbacks/128409.htmlAssignments

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 252    Accepted Submission(s): 125


Problem Description
In a factory, there are N workers to finish two types of tasks (A and B). Each type has N tasks. Each task of type A needs xi time to finish, and each task of type B needs yj time to finish, now, you, as the boss of the factory, need to make an assignment, which makes sure that every worker could get two tasks, one in type A and one in type B, and, what's more, every worker should have task to work with and every task has to be assigned. However, you need to pay extra money to workers who work over the standard working hours, according to the company's rule. The calculation method is described as follow: if someone’ working hour t is more than the standard working hour T, you should pay t-T to him. As a thrifty boss, you want know the minimum total of overtime pay.
 

Input
There are multiple test cases, in each test case there are 3 lines. First line there are two positive Integers, N (N<=1000) and T (T<=1000), indicating N workers, N task-A and N task-B, standard working hour T. Each of the next two lines has N positive Integers; the first line indicates the needed time for task A1, A2…An (Ai<=1000), and the second line is for B1, B2…Bn (Bi<=1000).
 

Output
For each test case output the minimum Overtime wages by an integer in one line.
 

Sample Input
2 5 4 2 3 5
 

Sample Output
4
 
//綆鍗曡椽蹇?/span>
#include <iostream>
#include 
<cstdio>
#include 
<algorithm>

const int maxn = 1000 + 5;

using namespace std;

bool cmp( int a, int b )
{
    
return a > b;
}


int main()
{
    
int a[maxn], b[maxn];
    
int n, t, ans = 0;
    
while( cin >> n >> t )
    
{
        ans 
= 0;
        
forint i = 0; i < n; i++ )
            cin 
>> a[i];
        
forint i = 0; i < n; i++ )
            cin 
>> b[i];

        sort( a, a 
+ n );
        sort( b, b 
+ n, cmp );

        
forint i = 0; i < n; i++ )
            
if( a[i] + b[i] > t )
                ans 
+= a[i] + b[i] - t;
        cout 
<< ans << endl;
    }

    
return 0;
}



Vontroy 2010-10-03 08:36 鍙戣〃璇勮
]]>
久久成人精品| 久久偷看各类wc女厕嘘嘘| 久久精品国产99久久香蕉| 一本久久a久久精品综合香蕉| 亚洲精品无码久久久久久| 97热久久免费频精品99| 久久婷婷国产剧情内射白浆| 国产成人综合久久综合| 久久无码专区国产精品发布 | 久久91亚洲人成电影网站| 久久精品无码av| 久久久久亚洲av无码专区导航| 色诱久久av| 精品久久久久久无码中文字幕 | 色偷偷久久一区二区三区| 精品久久久久久久久久中文字幕| 99精品国产在热久久| 蜜臀av性久久久久蜜臀aⅴ | 久久精品www| 99精品国产在热久久无毒不卡| 久久婷婷国产剧情内射白浆| 久久久精品波多野结衣| 四虎国产精品免费久久5151| 久久精品国产亚洲AV无码偷窥| 亚洲AV无码久久| 久久久久久久人妻无码中文字幕爆| 久久九九久精品国产免费直播| 久久亚洲精品国产精品婷婷| 亚洲精品无码久久毛片| 思思久久99热只有频精品66| 久久综合鬼色88久久精品综合自在自线噜噜| 亚洲国产精品久久久久婷婷软件| 狠狠色丁香婷综合久久| 国产精品久久久久久影院| 97精品国产97久久久久久免费 | 亚洲人成无码久久电影网站| 欧美亚洲另类久久综合婷婷| 2021国内久久精品| 久久精品无码专区免费东京热 | 久久久久久午夜成人影院| 国产日产久久高清欧美一区|