<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> __all__ = [ "<STR_LIT>" ] <EOL> import math <EOL> def max_tile_size ( tile_count , rect_size ) : <EOL> """<STR_LIT>""" <EOL> if rect_size [ <NUM_LIT:0> ] < rect_size [ <NUM_LIT:1> ] : <EOL> rect_size = rect_size [ <NUM_LIT:1> ] , rect_size [ <NUM_LIT:0> ] <EOL> rect_ar = rect_size [ <NUM_LIT:0> ] / rect_size [ <NUM_LIT:1> ] <EOL> tiles_max_height = int ( math . ceil ( math . sqrt ( tile_count ) ) ) <EOL> best_tile_size = <NUM_LIT:0> <EOL> for i in range ( <NUM_LIT:1> , tiles_max_height + <NUM_LIT:1> ) : <EOL> tiles_used = math . ceil ( tile_count / i ) , i <EOL> tile_ar = tiles_used [ <NUM_LIT:0> ] / tiles_used [ <NUM_LIT:1> ] <EOL> if tile_ar > rect_ar : <EOL> tile_size = rect_size [ <NUM_LIT:0> ] / tiles_used [ <NUM_LIT:0> ] <EOL> else : <EOL> tile_size = rect_size [ <NUM_LIT:1> ] / tiles_used [ <NUM_LIT:1> ] <EOL> if tile_size > best_tile_size : <EOL> best_tile_size = tile_size <EOL> return best_tile_size </s>
