DemidShumakher

1

Sep 28th, 2021 (edited)
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. def f(a,b,c,n=0,a1=0,b1=0,c1=0):
  2.     if a*a1+b*b1+c*c1==1000:
  3.         n+=1
  4.     c1+=1
  5.     if c1 == 1000//c:
  6.         b1 += 1
  7.         c1 = 0
  8.         if b1 == 1000//b:
  9.             b1 = 0
  10.             a1 += 1
  11.             if a1== 1000//a:
  12.                 return n
  13.     return f(a,b,c,a1=a1,b1=b1,n = n)
  14.  
  15.  
  16.  
  17.  
Add Comment
Please, Sign In to add comment