reads the number of intervals, their end points and integers. computes the minimal size of a set Z of integers which has at least ci common elements with interval [ai, bi], for each
You are given n closed, integer intervals [ai, bi] and n integers c_1, dots, c_n c 1 ,…,c n . Write a program that: reads the number of intervals, their end points and integers c_1, dots, c_n c 1 ,…,c n . from the standard input, computes the minimal size of a set Z of integers which has at least ci common elements with interval [ai, bi], for each i=1,2dots ,n i=1,2…,n, writes the answer to the standard output.
(图片来源网络,侵删)