Sid is a superior salesperson. So he gets a task from his boss. The task is that he will be given some number of products say k (All the products are same) and he has to travel N cities [1...N] to sell them. The main objective of the task is that he has to try to sell the product at higher price than previous city. For example if he sells a product at 100 Rs in one city then he has to try to sell the next product greater than 100 Rs in the next city and so on.

He travels all the cities and write down all the selling amounts. Now He wants to calculate maximum number of cities in which he could follow this increasing trend. And the maximum total prime money he could make in those cities. Help him in finding this.

**Note :** Number of products will always be equal to number of cities.

**Input:**

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. First line of each test case starts with an integer N denoting the size of the array A. Next line of input contains N space separated integers.

**Output:**

For each test case, In new line print the maximum number of cities and maximum total prime money with one space.

**Constraints:**

1 <= T <= 400

1 <= N <= 10^{6}

1 <= A[i] <= 10^{6 }

**Example:**

**Input:**

3

9

4 2 3 5 1 6 7 8 9

10

2 3 5 7 4 1 6 5 4 8

5

2 2 2 2 2

**Output:**

5 7

4 17

1 2

**Explanation:**

**For 1st test case**

5 cities are maximum number of cities in which the trend followed, And amount in those cities were 1, 6, 7, 8, 9. Out of these amounts only 7 is prime money.

**For 2nd test case**

4 cities are maximum number of cities in which the trend followed, And amount in those cities were 2, 3, 5, 7. Out of these amounts, maximum total prime money is 2+3+5+7=17.

**For 3rd test case**

He was successful in one city only, And maximum total prime money is 2.

Author: arun03

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Sulagna | 117 |

RUTVIKHARIPARA | 116 |

janvidavda105190 | 93 |

harshsiddhapura105461 | 93 |

devsinghindra | 80 |

PiyushPandey4 | 614 |

ASWATHAMA | 561 |

akhyasharma01 | 547 |

john_wick | 521 |

jagrit_07 | 443 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.