# DCP-468: Dev Point Back to All Problems

Medium Data Structures > Basic Data Structures

**Dev Point (DP)** is the currency of **Dev Skill**. A user can earn **DP** by contributing in Dev Skill: - Signing Up on Dev Skill (**500DP**) - Logging in the website. (**10DP** for login once everyday) - Report bug in feedback. (**50DP**) - Contributing Problem (**200DP** for each contribution) <br></br> Now here is a simple problem for you. Suppose, there are **N** user in Dev Skill. They have some initial DP. Dev SKill have **M** offers. Each offers will gift a certain amount of DP to users. There are also **Q** operations. Each operation is denoted by **X Y L R** : Applying all offers indexed between **X** to **Y (1 ≤ X ≤ Y ≤ M)** to all users indexed between **L** to **R (1 ≤ L ≤ R ≤ N).** You have to find the DP(Dev Point) of all users after performing all operations. Input: ------ Input starts with an integer **T (1 ≤ T ≤ 5)**, denoting the number of test cases. Each case contains three integers **N, M, Q (1 ≤ N, M, Q ≤ 100000)** denoting the number of users in Dev Skill, the number of offers and the number of operations respectfully. The next line will contain **N** integers separated by spaces, denoting the Dev Point of users. The ith integers denotes the Dev Point of ith user. **(1 ≤ i ≤ N, 1 ≤ DevPont[i] ≤ 100000)**. The next line will contain **M** integers separated by spaces, denoting the offeres. The ith integers denotes the Dev Point of ith offer. **(1 ≤ i ≤ M, 1 ≤ Offer[i] ≤ 100000)**. The next **Q** lines will denote the operations. Each line will contain four integers **X, Y, L** and **R**. Perform each operation as described above. Output: ------- For each case, in the first line, print the test case number formatted by **"Case tc:"**, where **tc** is the test case number. In the next line, print the final Dev Point of all users separated by spaces, be sure to avoid extra space. Sample Input ------------ 2 4 3 1 1 2 3 4 2 3 1 1 3 1 4 2 2 1 5 4 3 4 2 2 1 2 Sample Output ------------- Case 1: 7 8 9 10 Case 2: 9 8

### Problem Limits

 Language Time Limit (seconds) C 1.00 C++ 1.00 C++14 1.00 C# 2.00 Go 2.00 Java 2.00 JavaScript 2.00 Objective-C 2.00 Perl 2.00 PHP 2.00 Python 2.00 Python3 2.00 Ruby 2.00 VB.Net 2.00

# 143/333

Solve/Submission

### Ranking

# User Language Timing
01 FariD Cpp 0.12s
02 emrul Cpp 0.12s
03 feodorv C 0.23s
04 kissu_pari_na Cpp14 0.23s
06 shahincsejnu Cpp 0.28s
07 aaman007 Cpp 0.28s
08 _c_k_r_ Cpp 0.28s
09 robin_aust Cpp 0.29s
10 Rafiqul01 Cpp14 0.29s
11 anikatahsin Cpp 0.29s
12 Islam_Rafat Cpp14 0.29s
13 DynamicOvi Cpp 0.29s
14 Rajan_sust Cpp14 0.31s
15 SakibAlamin Cpp 0.35s
16 tanu_1603070 Cpp 0.35s
17 arman_ferdous Cpp 0.35s
18 Superstorm Cpp14 0.35s
19 Farhan_mahbub Cpp 0.35s
20 saiful130104 Cpp 0.36s
21 Sarwar05 Cpp 0.36s
22 we7d C 0.36s
23 anik_JU Cpp 0.36s
24 mh755628 Cpp 0.36s
25 mobasshir Cpp14 0.36s
26 _GhOstMan_ Cpp 0.36s
27 nasib_mbstu Cpp 0.36s
28 tariqiitju Cpp 0.36s
29 AlaminJust Cpp 0.36s
30 AbirRahman Cpp 0.36s
31 Mahbub_Rahman Cpp 0.36s
32 daihan_mbstu Cpp 0.37s
33 Durbin Cpp14 0.37s
34 m_arif Cpp14 0.37s
35 shamimjucse Cpp 0.37s
36 Ahb_arif Cpp 0.37s
38 QuwsarOhi Cpp14 0.38s
39 tlcakash Cpp 0.40s
40 Jisancse Cpp14 0.41s
41 Hasnaine Cpp 0.41s
42 prodipdatta7 Cpp 0.41s
43 enaim Cpp 0.46s
44 prateepm Cpp14 0.54s
45 IIUC_minhazmiraz Cpp14 0.55s
46 rayhan50001 Cpp 0.62s
47 sazal24_7 Cpp 0.66s
48 Faizul_BU Cpp 0.67s
49 yasirnabil534 Cpp 0.72s
50 inam Cpp14 0.73s
Feedback