B - MaratonIME challenges USPGameDev

秒速五厘米 2022-05-16 09:04 243阅读 0赞

Statements

Year after year, MaratonIME (group that authored this contest) and USPGameDev (game developing group at USP) fight epic clashes that last for centuries over which group will get each freshman to join them. This year, Russo (from MaratonIME) challenged Wil (from USPGameDev) to a dangerous match of darts.

Each one of them has already thrown their darts at the bullseye, but they can’t decide which one of them got closest to hitting the center of it. Each one of them claims to have won the match. You, as a fair freshman, decided to judge the clash yourself.

Two points on the 2d plane are given, r, the point where Russo’s dart hit, and w, the point where Wil’s dart hit. If r is closest to the origin (0, 0) than w, Russo won and you should print out “Russo” (no quotes) and join MaratonIME. If w and r are equally close to the origin, there’s a draw, you should print “Empate” (no quotes), which stands for “Draw” in portuguese, and join MaratonIME, because that was the agreed draw outcome. If w is closest to the origin than r, you should print “Wil” (no quotes) and join MaratonIME anyway, because it is the coolest group.

Input

On the first line of the input, a pair of integers x**r and y**r is given, the coordinates hit by Russo. On the second line another pair of integers x**w and y**w is given, the coordinates hit by Wil. Every coordinate is guaranteed not to exceed 10000 on absolute value, formally,  - 10000 ≤ x**r, y**r, x**w, y**w ≤ 10000.

Output

A single line containing “Russo”, “Wil” or “Empate”, acording to statement’s instructions.

Examples

Input

  1. 2 1
  2. 3 0

Output

  1. Russo

Input

  1. 10000 0
  2. 10000 1

Output

  1. Russo

题目大意及思路:给你圆心和半径,让你求到(0.0)的距离,通过比较距离,来输出最后的结果。

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int main()
  5. {
  6. int x1, y1, x2, y2;
  7. int sum1, sum2;
  8. scanf("%d %d", &x1, &y1);
  9. scanf("%d %d", &x2, &y2);
  10. sum1 = x1 * x1 + y1 * y1;
  11. sum2 = x2 * x2 + y2 * y2;
  12. if(sum1 < sum2)
  13. {
  14. printf("Russo\n");
  15. }
  16. else if(sum1 == sum2)
  17. {
  18. printf("Empate\n");
  19. }
  20. else
  21. {
  22. printf("Wil\n");
  23. }
  24. return 0;
  25. }

发表评论

表情:
评论列表 (有 0 条评论,243人围观)

还没有评论,来说两句吧...

相关阅读

    相关 challenge(一)前言

    一、写在前面        虽然从事android开发工作一年多了,但是一直没有自己完整的做一个app出来,这有时间的的因素,也有偶然,也有懒惰的因素,不管怎么来说,现在决定