Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int h(int a, int b, int c, int k) {
- if (a == 0) {
- if (b == 0) {
- if (c == 0) return k+1;
- else return h(a, b, c-1, k*(c+k+1)+k+1 );
- }
- if (c == 0) return h(a, b-1, k+1, k*(b+k+1)+k+1 );
- /*default*/ return h(a, b-1, h(a,b,c-1,k+1), k*(b+k+1)*(c+k+1)+k+1 );
- }
- if (b == 0) return h(a-1, k+1, c, k*(a+k+1)*(c+k+1)+k+1 );
- if (c == 0) return h(a, b-1, k+1, k*(a+k+1)*(b+k+1)+k+1 );
- /*default*/ return h(a, b-1, h(a,b,c-1,k+1), k*(a+k+1)*(b+k+1)*(c+k+1)+k+1 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement