CF53B.Blog Photo

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

One popular blog site edits the uploaded photos like this. It cuts a rectangular area out of them so that the ratio of height to width (i.e. the height/widthheight/width quotient) can vary from 0.8 to 1.25 inclusively. Besides, at least one side of the cut area should have a size, equal to some power of number 2 ( 2x2^{x} for some integer xx ). If those rules don't indicate the size of the cut are clearly, then the way with which the cut part possesses the largest area is chosen. Of course, both sides of the cut area should be integer. If there are several answers to this problem, you should choose the answer with the maximal height.

输入格式

The first line contains a pair of integers hh and ww ( 1<=h,w<=1091<=h,w<=10^{9} ) which are the height and width of the uploaded photo in pixels.

输出格式

Print two integers which are the height and width of the cut area.

输入输出样例

  • 输入#1

    2 1
    

    输出#1

    1 1
    
  • 输入#2

    2 2
    

    输出#2

    2 2
    
  • 输入#3

    5 5
    

    输出#3

    5 4
    
首页