Skip to content

Commit

Permalink
feat(2020-25/angch): part1
Browse files Browse the repository at this point in the history
  • Loading branch information
angch committed Dec 25, 2020
1 parent 4da75ed commit 9ee4ae3
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions 2020-25/angch/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package main

import (
"log"
)

func do(a, b int) (ret1 int, ret2 int) {

// 20201227
sub1, sub2 := 7, 7
target := a
loop1, loop2 := 0, 0
for loop1 = 1; sub1 != target; loop1++ {
sub1 *= 7
sub1 = sub1 % 20201227
// log.Println(ret1, sub1)
}

for loop2 = 1; sub2 != b; loop2++ {
sub2 *= 7
sub2 = sub2 % 20201227
}

e1, e2 := b, a
sub1, sub2 = b, a
log.Println("xform", sub1, loop1)
for i := 1; i < loop1; i++ {
sub1 *= e1
sub1 = sub1 % 20201227
}
for i := 1; i < loop2; i++ {
sub2 *= e2
sub2 = sub2 % 20201227
}
log.Println(sub1, sub2)

return ret1, ret2
}

func main() {
log.Println(do(5764801, 17807724))
//5764801
log.Println(do(8184785, 5293040))
}

0 comments on commit 9ee4ae3

Please sign in to comment.