forked from rajatgoyal715/Hackerrank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCountergame.java
More file actions
35 lines (31 loc) · 758 Bytes
/
Countergame.java
File metadata and controls
35 lines (31 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
static long a[] = new long[63];
static {
long n=1;
for(int i=0;i<63;i++){
a[i]=n;
n*=2;
}
}
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t--!=0){
boolean flag=true;
long n=sc.nextLong();
int i;
while(n>1){
for(i=0;a[i]<n;i++){
}
n-=a[i-1];
flag=!flag;
}
System.out.println((flag)?"Richard":"Louise");
}
}
}