JSFiddle - React, Tailwind, and code Playground

JavaScript

var mathjunk = 500/9;

var formattedtotal = Math.floor(mathjunk*100)/100;

var realtotal = formattedtotal * 9; 

var modulus = 500 - realtotal;

var diff = modulus / 5;

var first5 = formattedtotal+diff;

alert("first 5 get $"+first5+", everyone else gets $"+formattedtotal)