TA

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

TDS has initiated a New TA system for their classes, where each TA is assigned some

doubts to clear.There are n doubts till now, each characterized difficulty level of
the given doubt di and the rating associated with the doubt ri.There are k TA's
Available each having a certain skill ci, they can not solve the doubts having
difficulty level greater than ci. If you cannot find a TA skilled enough to solve a
particular doubt then that doubt will go pending in the system.
Recently Rishabh has been elected as the Event Management head, as a friend of
rishabh your task is to decide which doubts to resolve so that maximum rating is
achieved.
Input Format
First Line gives n - number of doubts 1 <= n <= 2000;
Each line contains 2 integers di and r1 1 <= di,ri <= 2000;
The Next Line contains k , the Number of TA's available
The Next Line contains k values indicating the Skill Level of every TA
Output Format
In The First Line print 2 integers a and b - number of resolved doubts and maximum
rating achieved
In next a lines print the number of Resolved doubt and number of the TA assigned to
solve that doubt
Test Case 1
10
739 307
523 658
700 143
373 577
120 433
353 833
665 516
988 101
817 604
800 551
Result
10
431 425 227 147 153 170 954 757 222 759
Test Case 2
2
2 100
1 1000
1
2
Result
1 1000
2 1
Test Case 3
7
172 864
853 523
368 989
920 452
351 456
269 104
313 677
9
165 47 259 51 693 941 471 871 206
Result
5 3509
3 7
1 9
7 5
2 8
5 6
Test Case 4
9
216 860
299 720
688 831
555 733
863 873
594 923
583 839
738 824
57 327
10
492 578 452 808 492 163 670 31 267 627
Result
7 5233
6 10
1 9
7 7
3 4
4 2
2 3
9 6
Test Case 5
10
739 307
523 658
700 143
373 577
120 433
353 833
665 516
988 101
817 604
800 551
10
431 425 227 147 153 170 954 757 222 759
Result
6 3621
6 2
2 8
9 7
4 1
7 10
5 4

You might also like