def adjust_size(back_height):
    """
    adjust scale(version) for QR code to 1-40.

    Parameters
    ------
    back_height: int
      height of background wallpaper
    """
    ver = int(back_height/300+0.5)
    if ver == 0:
        ver += 1
    elif ver > 39:
        ver = 39
    return ver