BETA
This is a school problem. Successful submissions of this are not counted in user ratings.

Submissions : 3404 Accuracy :

32.2

Check if an array is sorted
       

Given an array, write a program that prints 1 if array is sorted in non-decreasing order, else prints 0.

Input:

The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N,N is the size of array.
The second line of each test case contains N input C[i].

Output:

Print 1 if array is sorted, else print 0.

Constraints:

1 ≤ T ≤ 100
1 ≤ N ≤ 500
1 ≤ C[i] ≤ 1200

Example:

Input
2
5
10 20 30 40 50
6
90 80 100 70 40 30

Output
1
0

**For More Examples Use Expected Output**


Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.