<commit_before>import Control.Monad
import Data.List
import Data.List.Extra
import Data.Maybe
import qualified Data.Map as Map

--partitions :: Eq a => [a] -> [([a], [a])]
partitions cost xs =
  do l <- subsequences xs
     guard $ sum l == cost
     return (l, xs \\ l)

--partitions3 :: Eq a => [a] -> [([a], [a], [a])]
partitions3 cost l =
  do (a, b) <- partitions cost l
     (b', c) <- partitions cost b
     return (a, b', c)

--search :: [Int] -> Int
search packages =
  do (a, bcd) <- partitions cost packages
     guard $ length a <= 5 -- garbage
     guard $ not $ null $ partitions3 cost bcd
     return (length a, product a)

  where cost = sum packages `div` 4

--pack :: [Int] -> Int
pack packages = search packages

--solve :: String -> Int
solve = pack . map read . lines

answer f = interact $ (++"\n") . show . f
main = answer solve<commit_msg>... actually print out the answer<commit_after>import Control.Monad
import Data.List
import Data.List.Extra
import Data.Maybe
import qualified Data.Map as Map

--partitions :: Eq a => [a] -> [([a], [a])]
partitions cost xs =
  do l <- subsequences xs
     guard $ sum l == cost
     return (l, xs \\ l)

--partitions3 :: Eq a => [a] -> [([a], [a], [a])]
partitions3 cost l =
  do (a, b) <- partitions cost l
     (b', c) <- partitions cost b
     return (a, b', c)

--search :: [Int] -> Int
search packages =
  do (a, bcd) <- partitions cost packages
     guard $ length a <= 5 -- garbage
     guard $ not $ null $ partitions3 cost bcd
     return (length a, product a)

  where cost = sum packages `div` 4

--pack :: [Int] -> Int
pack packages = search packages

--solve :: String -> Int
solve = snd . minimum . pack . map read . lines

answer f = interact $ (++"\n") . show . f
main = answer solve
{'fraction_non_alphanumeric': 0.15720771850170262, 'fraction_numerical': 0.0056753688989784334, 'mean_word_length': 2.605316973415133, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4385524', 'n_tokens_mistral': 604, 'n_tokens_neox': 575, 'n_words': 238}