This is Java code to answer a question on Mathematics Stack Exchange about selecting box sizes to store documents.