Created
November 23, 2020 18:55
-
-
Save hansbogert/c18cb88e86de3ec91f5e5702a4078dae to your computer and use it in GitHub Desktop.
Revisions
-
hansbogert created this gist
Nov 23, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ #!/usr/bin/python3 # Use as ./program <total-wealth-as-int> import sys SCALE_1_END=72797 SCALE_2_END=1000000 FREE=30846 a=int(sys.argv[1]) grounds=a-FREE in_scale1 = min(grounds,SCALE_1_END) in_scale2 = min( max( grounds-SCALE_1_END, 0 ), SCALE_2_END-SCALE_1_END ) print("in scale 1 " + str(in_scale1)) print("in scale 2 " + str(in_scale2)) end = 0.67 * in_scale1 * 0.0007 end += 0.33 * in_scale1 * 0.0528 end += 0.21 * in_scale2 * 0.0007 end += 0.79 * in_scale2 * 0.0528 end *= 0.3 print("to pay: " + str(end))