UVA problem 305 (Joseph – Page 2)solution

Problem Solving, UVa

 

 

#include<bits/stdc++.h>

using namespace std;



int main()

{

   

    int n,a[15]={0,2,7,5,30,169,441,1872,7632,1740,93313,459901,1358657,2504881};

    while(cin>>n && n)

    {

        printf("%d\n",a[n]);

    }

    return 0;

}

 

0 Comments

You may find interest following article