Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by aditya on 17-10-2014.
- */
- import java.io.BufferedInputStream;
- import java.util.Scanner;
- public class Main {
- public static void main(String args[]){
- Scanner scan = new Scanner(new BufferedInputStream(System.in));
- int n=scan.nextInt();
- scan.close();
- System.out.println(ways(n));
- }
- public static int perm(int a,int b){
- int perm_num=1;
- for(int i=0;i<a-1;i++){
- perm_num*=(a+b-i)/(a-i);
- }
- return perm_num;
- }
- public static int ways(int r){
- int ways=0;
- for(int a=r,b=0;a>=0;b+=1,a-=2){
- ways+= (perm(a,b))%15746;
- }
- return ways;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement