Given an array **A** of **N** positive integers. Find the minimum number of operations (change a number to greater or lesser than original number) in array so that array is strictly increasing (A[i] < A[i+1]).

**Note : **The array should remain array of integers. For example, consider {6, 9, 7}, we cannot insert 6.x between and 7.

**Input:**

First line consists of T test cases. First line of every line test case consists of N, denoting number of elements in array. Second line of every test case consists of array elements.

**Output:**

Single line output, print the minimum operations to be done to make it strictly increasing.

**Constraints:**

1 <= T <= 10^{6 }

1 <= N <= 10^{6 }

1 <= A_{i} <= 10^{8}

**Example:
Input:**

2

6

1 2 3 6 5 4

7

1 2 3 4 5 6 7

2

0

Testcase 1:

Author: saksham seth

BadiMehnatLagtiHaiEasySawalMe | 480 |

Jihye Sofia Seo | 187 |

RohitBattu | 176 |

MaaChudaApniBadiMehnatLagtiHaiEasySawal | 173 |

piyushmittal25 | 172 |

AdityaSharma16 | 490 |

BadiMehnatLagtiHaiEasySawalMe | 480 |

saumitra13325 | 452 |

blackshadows | 430 |

ashujack | 401 |

blackshadows | 5188 |

akhayrutdinov | 5099 |

Ibrahim Nash | 5071 |

Quandray | 4354 |

sanjay05 | 3668 |

Login to report an issue on this page.