Underfull \hbox (badness 10000)
Every TeX user has been warned many times that their hboxes are terribly underfull or overfull. So much badness! This challenge is to rate how badly underfull or overfull a line of text is for a simplified line wrapper.
Task
You're given a space-separated string or list of words made of letters a-zA-Z. Output the minimal badness achievable for the first line.
The text needs to be wrapped on a line that's 10 characters wide, but it can only be split on spaces, no in the middle of words. Any letter that spills beyond the width counts for 1000 overfull badness each, and each leftover empty position at the end of the line counts for 1000 underfull badness.
ExamplesExample
For input Overfull"Overfull hboxhbox", we can keep the word "hbox" in the first line for 3000 overfull badness, or wrap it to the second line for 2000 underfull badness which is smaller, so the output is 2000.
0123456789 Overfull hbox ^^^ Overfull hbox ^^ Note that we don't care about badness of the second line.
ForDetails
The input is a space-separated string or a list of words made of letters Supercalifragilisticexpialidociousa-zA-Z. It won't have any words more than 10 letters long, we can't do anything putor be more than 20 characters in on one line for badness 24000total. It won't be empty or have any zero-length words.
Test cases
TODO
Sandbox: Is it OK to have a multiplier of 1000 for theme? Should the underfull and overfull badness penalties be different, like 1000 vs 2000?