John has been given a positive integer number N by Alice. Alice is very much fond of keys and loves to collect them,
and now she asks John to find the number of good keys with the given N. A good key is referred to as a
triplet (x, y, z) which satisfies the following constraints:-
Determine the total number of possible good keys which satisfy
the given conditions.
Complete the good_keys function provided in function takes the following parameter and returns an integer that represents the answer to the task as described problem statement:
Note: This is the input format that you must use
input
Print an integer denoting the number of good keys for the given task
3 ≤ N ≤ 106
There are no good keys satisfying the conditions given in the problem
So the answer to this given input becomes o
Note:
Your code must be able to print the sample output from the provided
sample input However, your code is run against multiple hidden test case
herofore, vour code must pass those noden tost cases to
Limite
Time Lime: 10 secis) for each input
Memory Limit: 256 MB
Source Limit 1024 KB
Score is assigned if any test case is passed
You are given 2 arrays A and B each consisting of integers.
Print the smallest number which is present in array A but missing in array sno such element exists print -1
Complete the function solve() which takes three parameters and retums an integer as the required output:
Note: This is the input format that you must use to provide custom input (available above the Compile and Test button).
The first line contains an integer N.
The second line contains an array A of N integers
The third fine contains an array B of N integers.
Print the smallest numbers which are present in array A but
missing in array B. If no such element exists, print -1.
Sample Input Sample Output
8 22
3 6 7 100 12 22 12 12
12 3 6 100 40 3 50 7
Your code must be able to print the sample output from the provided sample input. However, your code is run against multiple hidden test cases
Therefore, your code must pass these hidden test cases to solve the problem statement.
Time Limit: 10 secs) for each input file
Memory Limit 256 MB
Source Limit: 1024 KB
Scoring
Score is assigned if any testcase pass