Problem No: 1095 - Arrange the Numbers This problem has two parts. This is a typical combinatorics problem. #include<bits/stdc++.h> using namespace std ; #define ll long long #define mod 1000000007 #define N 1000 ll ncr [ N + 2 ] [ N + 2 ] ; ll fact [ N + 2 ] ; int main ( ) { ncr [ 0 ] [ 0 ] = 1 ; for ( int i = 1 ; i <= N ; i ++ ) { for ( int j = 0 ; j <= N ; j ++ ) { if ( j > i ) ncr [ i ] [ j ] = 0 ; else if ( j == 0 || i == j ) ncr [ i ] [ j ] = 1 ; ...