锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久国产乱子伦精品免费午夜,婷婷久久综合九色综合98,欧美伊人久久大香线蕉综合69http://www.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://www.shnenglu.com/vontroy/archive/2010/10/03/128409.htmlVontroyVontroySun, 03 Oct 2010 00:36:00 GMThttp://www.shnenglu.com/vontroy/archive/2010/10/03/128409.htmlhttp://www.shnenglu.com/vontroy/comments/128409.htmlhttp://www.shnenglu.com/vontroy/archive/2010/10/03/128409.html#Feedback0http://www.shnenglu.com/vontroy/comments/commentRss/128409.htmlhttp://www.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 鍙戣〃璇勮
]]>
欧美激情精品久久久久久| AV狠狠色丁香婷婷综合久久| 国产免费福利体检区久久| 久久成人18免费网站| 久久精品国产2020| 久久成人精品视频| 一级女性全黄久久生活片免费| 99久久99久久精品国产片果冻| 精品久久久久久亚洲精品| 久久午夜福利电影| 99久久免费国产精品热| 亚洲欧美久久久久9999| 久久精品国产免费一区| 国产aⅴ激情无码久久| 伊人色综合久久天天| 亚洲国产另类久久久精品小说 | 国产一级做a爰片久久毛片| 久久99国产精品成人欧美| 精品久久久久久久久午夜福利| 久久99精品久久久久久齐齐| 久久精品蜜芽亚洲国产AV| 欧美色综合久久久久久| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 久久久91人妻无码精品蜜桃HD| 久久精品亚洲中文字幕无码麻豆 | 国产A级毛片久久久精品毛片| 国产精品99久久久久久www| 久久精品国产亚洲av麻豆小说| 中文国产成人精品久久亚洲精品AⅤ无码精品| 无码精品久久久天天影视| 狠狠色丁香久久婷婷综合蜜芽五月| 久久精品一区二区国产| 国产亚洲欧美精品久久久| 无码精品久久久久久人妻中字 | 亚洲国产欧洲综合997久久| 久久无码AV中文出轨人妻| 久久精品无码免费不卡| 99久久精品国产一区二区三区 | 97精品伊人久久久大香线蕉| 久久精品免费一区二区| 久久精品国产亚洲AV影院|