Aws lambda functions are very fast, but you want to find out in which language they run the fastest. You are given N values for each language (Java & Python) which denote the time taken by lambda functions to run in milliseconds.
First N values are the time taken by AWS Lambda functions in java denoted by A[i].
Then next N values are the time taken by AWS Lambda functions in python denoted by B[i].
You have to find number of non-empty subsets (1,2,3,4,5......N) such that max of time taken by AWS Lambda functions in java are greater than or equal
to max of time taken by AWS Lambda functions in python, i.e. max(A[i]) >= max(B[i]) (here i is taken from the subset you choose from N elements). Since the count can be large, find it modulo 998244353.
Input Format
N-number of values
First N values are the time taken by AWS Lambda functions in java.
Then next N values are the time taken by AWS Lambda functions in python.
Constraints
1<=N<=5000
1<=A[i], B[i]<= 5000
Test Case
Input
2
31
12
Output
2
code in python

Q&A Education