[Solution] Maximum Pairwise Modular Sum CodeChef Solution | CodeChef Problem Solution 2022
You are given an array containing integers, and a positive integer . Find the maximum value of
across all pairs .
Solution Click Below:- CLICK HERE
Note that refers to the smallest non-negative integer obtained as the remainder upon dividing by . For example, and .
Input Format
- The first line of input will contain a single integer , the number of test cases. The description of test cases follows.
- Each test case consists of two lines of input.
- The first line of each test case contains two space-separated integers and .
- The second line of each test case contains space-separated integers .
Output Format
Solution Click Below:- CLICK HERE
- For each test case, output on a new line the maximum value of .
Constraints
- The sum of across all test cases won't exceed .
Subtasks
- Subtask 1 (10 points):
- The sum of across all test cases won't exceed
- Subtask 2 (20 points):
- Subtask 3 (70 points):
- Original constraints
Solution Click Below:- CLICK HERE
No comments:
Post a Comment