Under construction

Still being built. Things may change

Who Wins?

Interview

Time limit1sMemory limit1024 MB

Summary
Given two lists of coding skills, count how many cross-team matches HI wins, how many ARC wins, and how many end in a draw.
Level

Easy3 of 10

Topics
Prefix sum, Sorting, Array
Solved
No attempts yet

Problem

HI-ARC is holding a friendly competition at the end of the semester, split into the HI team and the ARC team. The HI team has NN members and the ARC team has MM members. Every member of one team plays exactly one match against every member of the other team, so the competition consists of N×MN \times M matches. Each participant has a coding skill. In a match, the participant with the higher coding skill wins, and if the two skills are equal, the match is a draw.

Hayak wants to know the results of the competition early. Predict the results for Hayak.

Input

The first line contains the number of HI team members NN and the number of ARC team members MM, separated by a space. (1≤N,M≤100 000)(1 \leq N, M \leq 100\,000)

The second line contains a sequence aa of length NN, the coding skills of the HI team members, separated by spaces. (1≤ai≤100 000)(1 \leq a_i \leq 100\,000)

The third line contains a sequence bb of length MM, the coding skills of the ARC team members, separated by spaces. (1≤bi≤100 000)(1 \leq b_i \leq 100\,000)

Output

Print three integers separated by spaces: the number of wins for HI team participants, the number of wins for ARC team participants, and the number of draws.

Examples2

  1. Example 1

    Input
    4 3
    1000 90 3 20000
    1 3 100000
    
    Expected output
    7 4 1
    
  2. Example 2

    Input
    5 5
    1 2 3 4 5
    1 2 3 4 5
    
    Expected output
    10 10 5