A. Koxia and Whiteboards Codeforces Good Bye 2022: 2023 is NEAR Problem Solution                          

This post is all about the solution of the A. Koxia and Whiteboards Codeforces Good Bye 2022: 2023 is NEAR Problem Statement.

A. Koxia and Whiteboards Codeforces Good Bye 2022: 2023 is NEAR Problem Solution

Codeforces



AI based Love Calculator



Problem Statement :

Kiyora has n whiteboards with numbers ranging from 1 to n. Initially, the integer ai is written on the i-th whiteboard.

Koxia carries out m operations. The j-th operation involves selecting one of the whiteboards and changing the integer written on it to bj.

After performing all m operations, determine the largest possible sum of the integers written on the whiteboards.


Format of Input :

Each test is made up of several test cases. The first line includes a single integer t (1t1000) indicating the number of test cases. The following is a description of the tests.

Evey test case's first line contains two integers n and m (1n,m100).

Evey test case's second line includes n integers a1,a2,...,an (1ai109).

Evey test case's third category represents m integers b1,b2,...,bm (1bi109).

Format of the Output :

Output a single integer for each test case — the largest possible sum of integers written on whiteboards after conducting all m operations.

Also Check this out:-

A. Koxia and Whiteboards Codeforces Good Bye 2022: 2023 is NEAR Problem Solution, Click Here
B. Koxia and Permutation Codeforces Good Bye 2022: 2023 is NEAR Problem Solution, Click Here
C. Koxia and Number Theory Codeforces Good Bye 2022: 2023 is NEAR Problem Solution, Click Here
D. Koxia and Game Codeforces Good Bye 2022: 2023 is NEAR Problem Solution, Click Here 
E. Koxia and Tree Codeforces Good Bye 2022: 2023 is NEAR Problem Solution, Click Here
Solution of the Problem: Click Here