<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class Solution ( object ) : <EOL> def __init__ ( self ) : <EOL> self . combs = { } <EOL> def solve ( self , cipher ) : <EOL> """<STR_LIT>""" <EOL> C , N = cipher <EOL> return self . get_combinations ( N , C , <NUM_LIT:0> ) <EOL> def get_combinations ( self , t , lst , k ) : <EOL> if t == <NUM_LIT:0> : <EOL> return <NUM_LIT:1> <EOL> if t < <NUM_LIT:0> or k >= len ( lst ) : <EOL> return <NUM_LIT:0> <EOL> if ( t , k ) not in self . combs : <EOL> cnt = <NUM_LIT:0> <EOL> while t >= <NUM_LIT:0> : <EOL> cnt += self . get_combinations ( t , lst , k + <NUM_LIT:1> ) <EOL> t -= lst [ k ] <EOL> self . combs [ ( t , k ) ] = cnt <EOL> return self . combs [ ( t , k ) ] <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> import sys <EOL> f = open ( "<STR_LIT>" , "<STR_LIT:r>" ) <EOL> solution = Solution ( ) <EOL> C = map ( int , f . readline ( ) . strip ( ) . split ( '<STR_LIT:U+002CU+0020>' ) ) <EOL> N = int ( f . readline ( ) . strip ( ) ) <EOL> cipher = C , N <EOL> s = "<STR_LIT>" % ( solution . solve ( cipher ) ) <EOL> print s , </s>
