<s> from pyswip import Prolog , Functor , Variable , Query <EOL> def main ( ) : <EOL> prolog = Prolog ( ) <EOL> prolog . consult ( "<STR_LIT>" ) <EOL> count = int ( raw_input ( "<STR_LIT>" ) or <NUM_LIT:100> ) <EOL> total = int ( raw_input ( "<STR_LIT>" ) or <NUM_LIT> ) <EOL> coins = Functor ( "<STR_LIT>" , <NUM_LIT:3> ) <EOL> S = Variable ( ) <EOL> q = Query ( coins ( S , count , total ) ) <EOL> i = <NUM_LIT:0> <EOL> while q . nextSolution ( ) : <EOL> s = zip ( S . value , [ <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:10> , <NUM_LIT:50> , <NUM_LIT:100> ] ) <EOL> print i , <EOL> for c , v in s : <EOL> print "<STR_LIT>" % ( c , v ) , <EOL> print <EOL> i += <NUM_LIT:1> <EOL> q . closeQuery ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
