CF958A3.Death Stars (hard)

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

The first line of the input contains an integer NN ( 1000<=N<=500001000<=N<=50000 ) – the number of Death Stars. The second line of the input contains an integer N1N_{1} ( N<=N1<=1.5NN<=N_{1}<=1.5·N ) – the number of stars in the first map. The next N1N_{1} lines specify the coordinates of the stars in the first map. The ii -th line contains two space-separated floating-point numbers xix_{i} and yiy_{i} with two decimal digits of precision each, representing the coordinates of the ii -th star in the first map.

The next line of the input contains an integer N2N_{2} ( N<=N2<=1.5NN<=N_{2}<=1.5·N ) – the number of stars in the second map. The next N2N_{2} lines contain locations of the stars in the second map, given in the same format as for the first map.

输入格式

输出格式

The tests are generated in the following way:

  • The number of Death Stars NN is pre-selected in some way.
  • The numbers of stars on the first and on the second map, N1N_{1} and N2N_{2} , are selected uniformly at random between 1.0×N1.0×N and 1.5×N1.5×N .
  • NN Death Stars are generated at random, with coordinates between 10000-10000 and 1000010000 .
  • Additional N1NN_{1}-N and N2NN2-N stars for the first and for the second map respectively are generated in the same way.
  • A translation vector (dx,dy)(dx,dy) is generated, with dxdx and dydy selected uniformly at random between 10000-10000 and 1000010000 . Each point in the first map is translated by (dx,dy)(dx,dy) .
  • A rotation angle θθ is generated, with θθ selected uniformly at random between 00 and 2π . Each point in the first map is rotated by an angle of θθ around the origin.
  • Translations and rotations for the second map are generated and applied in the same way.
  • The order of points is randomly permuted for both maps.
  • The test case is saved, with each point written with two decimal digits of precision.

输入输出样例

  • 输入#1

    10 5
    somer
    andom
    noise
    mayth
    eforc
    ebewi
    thyou
    hctwo
    again
    noise
    somermayth
    andomeforc
    noiseebewi
    againthyou
    noisehctwo
    

    输出#1

    4 6
    
  • 输入#2

    2
    XX
    OO
    XO
    OX
    

    输出#2

    No
    

说明/提示

The tests are generated in the following way:

  • The number of Death Stars NN is pre-selected in some way.
  • The numbers of stars on the first and on the second map, N1N_{1} and N2N_{2} , are selected uniformly at random between 1.0×N1.0×N and 1.5×N1.5×N .
  • NN Death Stars are generated at random, with coordinates between 10000-10000 and 1000010000 .
  • Additional N1NN_{1}-N and N2NN2-N stars for the first and for the second map respectively are generated in the same way.
  • A translation vector (dx,dy)(dx,dy) is generated, with dxdx and dydy selected uniformly at random between 10000-10000 and 1000010000 . Each point in the first map is translated by (dx,dy)(dx,dy) .
  • A rotation angle θθ is generated, with θθ selected uniformly at random between 00 and 2π . Each point in the first map is rotated by an angle of θθ around the origin.
  • Translations and rotations for the second map are generated and applied in the same way.
  • The order of points is randomly permuted for both maps.
  • The test case is saved, with each point written with two decimal digits of precision.
首页