Skip to main content
5 of 7
added 8 characters in body
Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56

Java (JDK 10), 115 bytes

s->"8%06(*D0t0".charAt(s.replace("g","").chars().sum()%77%24%13)*(278-s.charAt(0))/3080d*(s.endsWith("g")?.75:1)

Try it online!

Credits

Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56