Skip to content

Instantly share code, notes, and snippets.

@hansbogert
Created November 23, 2020 18:55
Show Gist options
  • Save hansbogert/c18cb88e86de3ec91f5e5702a4078dae to your computer and use it in GitHub Desktop.
Save hansbogert/c18cb88e86de3ec91f5e5702a4078dae to your computer and use it in GitHub Desktop.

Revisions

  1. hansbogert created this gist Nov 23, 2020.
    33 changes: 33 additions & 0 deletions gistfile1.txt
    Original 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))