我的数据框有2个变量
structure(list(X1 = structure(c(17L, 27L, 6L, 1L, 28L, 1L, 1L,4L, 17L, 28L, 28L, 12L, 21L, 28L, 28L, 8L, 28L, 1L, 1L, 10L, 4L, 21L, 30L, 1L, 8L, 28L, 1L, 1L, 1L, 1L, 8L, 1L, 17L, 1L, 1L, 28L, 8L, 23L, 15L, 23L, 25L, 13L, 8L, 4L, 28L, 10L, 1L, 30L, 13L, 4L, 1L, 1L, 17L, 13L, 13L, 8L, 4L, 4L, 4L, 28L, 28L, 13L,1L, 4L, 28L, 1L, 1L, 1L, 1L, 1L, 12L, 2L, 6L, 1L, 8L, 1L, 21L, 1L, 21L, 1L, 30L,13L, 25L, 17L, 1L, 28L, 13L, 1L, 1L, 1L, 1L,8L, 30L, 25L, 28L, 4L, 1L, 13L, 17L, 4L,1L, 1L, 28L, 1L, 1L, 8L, 1L, 8L, 1L, 13L, 1L, 1L, 1L, 4L, 6L, 1L, 1L, 30L,1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 6L, 6L, 1L, 15L, 21L, 10L, 21L, 1L, 10L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 28L, 28L, 1L, 30L, 15L, 25L, 6L, 17L, 25L, 15L, 8L, 18L, 22L, 14L, 22L, 28L, 30L, 3L, 30L, 14L, 18L, 22L, 24L, 10L, 26L, 26L, 18L, 26L, 30L, 29L, 18L, 14L, 9L, 9L, 16L, 16L, 29L, 18L, 16L, 27L, 24L, 14L, 26L, 5L, 22L, 28L, 22L, 11L, 9L, 26L, 30L, 18L, 28L, 16L, 26L, 7L, 30L, 7L, 28L, 5L, 18L, 9L, 26L, 24L, 27L, 16L, 16L, 14L, 26L, 29L, 5L, 22L, 24L, 26L, 18L, 27L, 9L, 18L, 11L, 14L, 18L, 22L, 29L, 26L, 22L, 26L, 20L, 24L, 14L, 7L, 16L, 24L, 26L, 29L, 24L, 24L, 24L, 20L, 20L, 24L, 11L, 20L, 29L, 16L, 18L, 24L, 24L, 7L, 24L, 18L, 11L, 11L, 24L, 24L, 7L, 11L, 18L, 24L, 24L, 16L, 29L, 7L, 30L, 24L, 22L, 24L, 18L, 26L, 9L, 9L, 24L, 29L, 9L, 24L, 30L, 11L, 24L, 16L, 26L, 26L, 26L, 30L, 26L, 16L, 26L, 24L, 29L, 20L, 24L, 14L, 9L, 7L, 29L, 29L, 15L, 6L, 15L, 2L, 6L, 6L, 3L, 2L, 17L, 30L, 27L, 23L, 2L, 15L, 8L, 13L, 21L, 28L, 23L, 25L, 1L, 25L, 19L, 27L, 23L, 15L, 19L, 19L, 23L, 2L, 27L, 27L, 15L, 2L, 2L, 3L, 23L, 2L, 23L, 6L, 2L, 15L, 13L,1L, 1L, 13L, 28L, 1L, 1L, 28L, 21L, 1L, 28L, 4L, 1L, 17L, 17L, 13L, 21L, 1L, 1L, 1L, 17L, 1L, 1L, 17L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 13L, 1L, 1L, 1L, 1L, 8L,25L, 1L, 28L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 8L, 4L, 1L, 25L, 28L, 13L, 1L, 1L, 28L, 1L, 4L, 1L, 1L, 8L, 1L, 8L, 13L, 4L, 28L, 21L, 28L, 28L, 28L, 28L, 28L, 8L, 1L, 1L, 1L, 1L, 13L, 21L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 28L, 4L, 1L, 17L, 17L, 28L, 1L, 13L, 8L, 17L, 1L, 13L, 13L, 8L, 4L, 1L, 17L, 25L, 1L, 1L, 8L, 8L, 1L, 4L, 17L, 21L),
.Label = c("<8", ">1024", "1024", "11", "11.000000000000007", "128", "128.00000000000009", "16", "16.000000000000007", "181", "181.00000000000006", "22", "23", "23.000000000000011", "256", "256.00000000000017", "32", "32.000000000000014", "362", "362.00000000000017", "45", "45.000000000000014", "512", "512.00000000000045", "64", "64.000000000000028", "724", "8", "8.0000000000000018", "90"),
class = "factor"),
X2 = structure(c(7L, 2L, 2L, 8L, 18L, 4L, 13L, 18L, 8L, 13L, 8L, 18L, 12L, 13L, 18L, 16L, 7L, 5L, 1L, 16L, 18L, 18L, 18L, 12L, 7L, 1L, 4L, 4L, 2L,16L, 12L, 12L, 2L, 2L, 13L, 13L, 18L, 2L, 16L, 2L, 16L, 16L, 2L, 12L, 16L, 2L, 12L,2L, 2L, 16L, 16L, 2L, 2L, 2L, 2L, 2L, 7L, 18L, 18L, 18L, 13L, 18L, 13L, 18L, 9L, 13L, 8L, 4L, 1L, 13L, 8L, 2L, 16L, 12L, 7L, 7L, 18L, 18L, 18L, 12L, 16L, 7L, 16L, 7L, 12L, 12L, 16L, 12L, 13L, 13L, 12L, 16L, 12L, 12L, 7L, 7L, 13L,16L, 7L, 18L, 16L, 13L, 18L, 4L, 12L, 7L, 4L, 18L, 18L, 18L, 9L, 17L, 13L, 7L, 12L, 7L, 18L, 12L, 18L, 13L, 9L, 1L, 18L, 1L, 13L, 13L, 13L, 1L, 1L, 13L, 12L, 4L, 1L,1L, 4L, 12L, 9L, 1L, 1L, 1L, 2L, 12L, 9L, 2L, 18L, 2L, 18L, 7L, 12L, 1L, 9L, 9L, 7L, 18L, 9L, 18L, 1L, 12L, 13L, 12L, 16L, 7L, 12L, 7L, 16L, 2L, 12L,7L, 16L, 12L, 16L, 2L, 12L, 2L, 15L, 7L, 7L, 2L, 7L, 3L, 12L, 16L, 1L, 17L, 2L, 18L, 5L, 7L, 1L, 16L, 7L, 10L, 1L, 12L, 18L, 16L, 16L, 13L, 12L, 7L, 2L, 1L, 9L, 18L, 12L, 13L, 2L, 2L, 12L, 2L, 2L, 2L, 16L, 2L, 1L, 18L, 12L, 7L, 2L, 2L, 12L, 7L, 12L, 4L, 2L, 18L, 13L, 2L, 16L, 7L, 2L, 2L, 12L, 2L, 14L, 12L, 12L, 16L, 1L, 2L, 4L, 2L, 2L, 2L, 17L, 2L, 2L, 2L, 18L, 16L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 12L, 2L, 2L, 1L, 2L, 12L, 18L, 2L, 15L, 16L, 16L, 2L, 2L, 2L, 2L, 11L, 12L, 14L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 16L, 16L, 12L, 2L, 12L, 2L, 2L, 2L, 12L, 2L,16L, 2L, 12L, 14L, 7L, 2L, 4L, 14L, 2L, 16L, 15L, 7L, 16L, 18L, 2L, 16L, 2L, 2L, 12L, 12L, 2L, 2L, 4L, 2L, 2L, 2L, 16L, 2L, 12L,18L, 3L, 16L, 2L, 2L, 13L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 16L, 16L, 2L, 2L, 4L, 4L, 11L, 13L, 4L, 4L, 8L, 4L, 13L, 1L, 4L, 1L, 1L, 2L, 2L, 11L, 18L, 8L, 8L, 4L, 7L, 8L, 4L, 8L, 4L, 4L, 8L, 8L, 1L, 4L, 8L, 4L, 13L, 1L, 6L, 1L, 17L, 2L, 2L, 8L, 18L, 8L, 8L, 4L, 7L, 8L, 17L, 8L, 4L, 1L, 4L, 13L, 1L, 2L, 4L, 16L, 13L, 4L, 4L, 17L, 4L, 7L, 4L, 4L, 1L, 1L, 4L, 1L, 17L, 8L, 1L, 8L, 1L, 4L, 1L, 8L, 8L, 8L, 1L, 13L, 16L, 16L, 17L, 8L, 13L, 1L, 4L, 7L, 1L, 1L, 4L, 4L, 8L, 6L, 4L, 1L, 12L, 13L, 8L, 4L, 4L, 18L, 2L, 4L, 8L, 13L, 17L,13L, 18L, 7L, 16L, 7L, 1L, 13L, 8L, 13L, 4L, 1L, 7L),
.Label = c("<8", ">1024", "1024", "11", "128", "16", "181", "22", "23", "256", "32", "362", "45", "512", "64", "724", "8", "90"), class = "factor")),
.Names = c("X1", "X2"),
row.names = c(NA, -471L),
class = "data.frame")
我有两个问题
1)每个都有一些大于值,一些小于值。我想从数据框中删除>
和<
字符,并仅保留数据框中的数字。我可以在excel中完成它,但我想学习在R中学习它的代码。
2)我想将小数位数减少为整数/整数,因为有些小数位数更多。
这可能是一个小问题,但我正在努力做到这一点。我非常感谢你的帮助。
答案 0 :(得分:2)
dplyr::mutate_all
和stringr::str_replace_all
。 as.numeric
直接近似,因为它的大小为10^(-13)
。
your_df <- structure(list(X1 = structure(c(17L, 27L, 6L, 1L, 28L, 1L, 1L,4L, 17L, 28L, 28L, 12L, 21L, 28L, 28L, 8L, 28L, 1L, 1L, 10L, 4L, 21L, 30L, 1L, 8L, 28L, 1L, 1L, 1L, 1L, 8L, 1L, 17L, 1L, 1L, 28L, 8L, 23L, 15L, 23L, 25L, 13L, 8L, 4L, 28L, 10L, 1L, 30L, 13L, 4L, 1L, 1L, 17L, 13L, 13L, 8L, 4L, 4L, 4L, 28L, 28L, 13L,1L, 4L, 28L, 1L, 1L, 1L, 1L, 1L, 12L, 2L, 6L, 1L, 8L, 1L, 21L, 1L, 21L, 1L, 30L,13L, 25L, 17L, 1L, 28L, 13L, 1L, 1L, 1L, 1L,8L, 30L, 25L, 28L, 4L, 1L, 13L, 17L, 4L,1L, 1L, 28L, 1L, 1L, 8L, 1L, 8L, 1L, 13L, 1L, 1L, 1L, 4L, 6L, 1L, 1L, 30L,1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 6L, 6L, 1L, 15L, 21L, 10L, 21L, 1L, 10L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 28L, 28L, 1L, 30L, 15L, 25L, 6L, 17L, 25L, 15L, 8L, 18L, 22L, 14L, 22L, 28L, 30L, 3L, 30L, 14L, 18L, 22L, 24L, 10L, 26L, 26L, 18L, 26L, 30L, 29L, 18L, 14L, 9L, 9L, 16L, 16L, 29L, 18L, 16L, 27L, 24L, 14L, 26L, 5L, 22L, 28L, 22L, 11L, 9L, 26L, 30L, 18L, 28L, 16L, 26L, 7L, 30L, 7L, 28L, 5L, 18L, 9L, 26L, 24L, 27L, 16L, 16L, 14L, 26L, 29L, 5L, 22L, 24L, 26L, 18L, 27L, 9L, 18L, 11L, 14L, 18L, 22L, 29L, 26L, 22L, 26L, 20L, 24L, 14L, 7L, 16L, 24L, 26L, 29L, 24L, 24L, 24L, 20L, 20L, 24L, 11L, 20L, 29L, 16L, 18L, 24L, 24L, 7L, 24L, 18L, 11L, 11L, 24L, 24L, 7L, 11L, 18L, 24L, 24L, 16L, 29L, 7L, 30L, 24L, 22L, 24L, 18L, 26L, 9L, 9L, 24L, 29L, 9L, 24L, 30L, 11L, 24L, 16L, 26L, 26L, 26L, 30L, 26L, 16L, 26L, 24L, 29L, 20L, 24L, 14L, 9L, 7L, 29L, 29L, 15L, 6L, 15L, 2L, 6L, 6L, 3L, 2L, 17L, 30L, 27L, 23L, 2L, 15L, 8L, 13L, 21L, 28L, 23L, 25L, 1L, 25L, 19L, 27L, 23L, 15L, 19L, 19L, 23L, 2L, 27L, 27L, 15L, 2L, 2L, 3L, 23L, 2L, 23L, 6L, 2L, 15L, 13L,1L, 1L, 13L, 28L, 1L, 1L, 28L, 21L, 1L, 28L, 4L, 1L, 17L, 17L, 13L, 21L, 1L, 1L, 1L, 17L, 1L, 1L, 17L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 13L, 1L, 1L, 1L, 1L, 8L,25L, 1L, 28L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 8L, 4L, 1L, 25L, 28L, 13L, 1L, 1L, 28L, 1L, 4L, 1L, 1L, 8L, 1L, 8L, 13L, 4L, 28L, 21L, 28L, 28L, 28L, 28L, 28L, 8L, 1L, 1L, 1L, 1L, 13L, 21L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 28L, 4L, 1L, 17L, 17L, 28L, 1L, 13L, 8L, 17L, 1L, 13L, 13L, 8L, 4L, 1L, 17L, 25L, 1L, 1L, 8L, 8L, 1L, 4L, 17L, 21L), .Label = c("<8", ">1024", "1024", "11", "11.000000000000007", "128", "128.00000000000009", "16", "16.000000000000007", "181", "181.00000000000006", "22", "23", "23.000000000000011", "256", "256.00000000000017", "32", "32.000000000000014", "362", "362.00000000000017", "45", "45.000000000000014", "512", "512.00000000000045", "64", "64.000000000000028", "724", "8", "8.0000000000000018", "90"), class = "factor"), X2 = structure(c(7L, 2L, 2L, 8L, 18L, 4L, 13L, 18L, 8L, 13L, 8L, 18L, 12L, 13L, 18L, 16L, 7L, 5L, 1L, 16L, 18L, 18L, 18L, 12L, 7L, 1L, 4L, 4L, 2L,16L, 12L, 12L, 2L, 2L, 13L, 13L, 18L, 2L, 16L, 2L, 16L, 16L, 2L, 12L, 16L, 2L, 12L,2L, 2L, 16L, 16L, 2L, 2L, 2L, 2L, 2L, 7L, 18L, 18L, 18L, 13L, 18L, 13L, 18L, 9L, 13L, 8L, 4L, 1L, 13L, 8L, 2L, 16L, 12L, 7L, 7L, 18L, 18L, 18L, 12L, 16L, 7L, 16L, 7L, 12L, 12L, 16L, 12L, 13L, 13L, 12L, 16L, 12L, 12L, 7L, 7L, 13L,16L, 7L, 18L, 16L, 13L, 18L, 4L, 12L, 7L, 4L, 18L, 18L, 18L, 9L, 17L, 13L, 7L, 12L, 7L, 18L, 12L, 18L, 13L, 9L, 1L, 18L, 1L, 13L, 13L, 13L, 1L, 1L, 13L, 12L, 4L, 1L,1L, 4L, 12L, 9L, 1L, 1L, 1L, 2L, 12L, 9L, 2L, 18L, 2L, 18L, 7L, 12L, 1L, 9L, 9L, 7L, 18L, 9L, 18L, 1L, 12L, 13L,
12L, 16L, 7L, 12L, 7L, 16L, 2L, 12L,7L, 16L, 12L, 16L, 2L, 12L, 2L, 15L, 7L, 7L, 2L, 7L, 3L, 12L, 16L, 1L, 17L, 2L, 18L, 5L, 7L, 1L, 16L, 7L, 10L, 1L, 12L, 18L, 16L, 16L, 13L, 12L, 7L, 2L, 1L, 9L, 18L, 12L, 13L, 2L, 2L, 12L, 2L, 2L, 2L, 16L, 2L, 1L, 18L, 12L, 7L, 2L, 2L, 12L, 7L, 12L, 4L, 2L, 18L, 13L, 2L, 16L, 7L, 2L, 2L, 12L, 2L, 14L, 12L, 12L, 16L, 1L, 2L, 4L, 2L, 2L, 2L, 17L, 2L, 2L, 2L, 18L, 16L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 12L, 2L, 2L, 1L, 2L, 12L, 18L, 2L, 15L, 16L, 16L, 2L, 2L, 2L, 2L, 11L, 12L, 14L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 16L, 16L, 12L, 2L, 12L, 2L, 2L, 2L, 12L, 2L,16L, 2L, 12L, 14L, 7L, 2L, 4L, 14L, 2L, 16L, 15L, 7L, 16L, 18L, 2L, 16L, 2L, 2L, 12L, 12L, 2L, 2L, 4L, 2L, 2L, 2L, 16L, 2L, 12L,18L, 3L, 16L, 2L, 2L, 13L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 16L, 16L, 2L, 2L, 4L, 4L, 11L, 13L, 4L, 4L, 8L, 4L, 13L, 1L, 4L, 1L, 1L, 2L, 2L, 11L, 18L, 8L, 8L, 4L, 7L, 8L, 4L, 8L, 4L, 4L, 8L, 8L, 1L, 4L, 8L, 4L, 13L, 1L, 6L, 1L, 17L, 2L, 2L, 8L, 18L, 8L, 8L, 4L, 7L, 8L, 17L, 8L, 4L, 1L, 4L, 13L, 1L, 2L, 4L, 16L, 13L, 4L, 4L, 17L, 4L, 7L, 4L, 4L, 1L, 1L, 4L, 1L, 17L, 8L, 1L, 8L, 1L, 4L, 1L, 8L, 8L, 8L, 1L, 13L, 16L, 16L, 17L, 8L, 13L, 1L, 4L, 7L, 1L, 1L, 4L, 4L, 8L, 6L, 4L, 1L, 12L, 13L, 8L, 4L, 4L, 18L, 2L, 4L, 8L, 13L, 17L,13L, 18L, 7L, 16L, 7L, 1L, 13L, 8L, 13L, 4L, 1L, 7L),
.Label = c("<8", ">1024", "1024", "11", "128", "16", "181", "22", "23", "256", "32", "362", "45", "512", "64", "724", "8", "90"), class = "factor")), .Names = c("X1", "X2"), row.names = c(NA, -471L), class = "data.frame")
library(dplyr)
library(stringr)
mutate_all(your_df, function(x) as.numeric(str_replace_all(x, pattern = "<|>", replacement = "")))
#> X1 X2
#> 1 32 181
#> 2 724 1024
#> 3 128 1024
#> 4 8 22
#> 5 8 90
#> 6 8 11
#> 7 8 45
#> 8 11 90
#> 9 32 22
#> 10 8 45
#> 11 8 22
#> 12 22 90
#> 13 45 362
答案 1 :(得分:1)
您可以使用基础R执行此操作:
my_df <- as.data.frame(sapply(my_df, gsub, pattern = "<|>", replacement = ""))
my_df <- as.data.frame(sapply(my_df, as.numeric))
my_df
# X1 X2
# 1 8 23
# 2 8 90
# 3 8 8
# 4 8 362
# 5 8 45
# 6 90 362
# 7 256 724
# 8 64 181
# 9 128 362
# 10 32 181
# 11 64 724
# 12 256 1024
# 13 16 362
# 14 32.000000000000014 181
# 15 45.000000000000014 724
# 16 23.000000000000011 362
# 17 45.000000000000014 724
# 18 8 1024
# 19 90 362
# 20 1024 1024
# 21 90 64
# 22 23.000000000000011 181
# 23 32.000000000000014 181
# 24 45.000000000000014 1024
# 25 512.00000000000045 181
如果您只想舍入小数,但保持&lt;和&gt;标志你可以做到以下(没有完成上述步骤):
sapply(my_df,
function(x) paste0(gsub(x, pattern = "\\d|\\.", replacement = ""),
round(as.numeric(gsub(x, pattern = "<|>", replacement = "")))))
# X1 X2
# [1,] "<8" "23"
# [2,] "<8" "90"
# [3,] "8" "<8"
# [4,] "8" "362"
# [5,] "<8" "45"
# [6,] "90" "362"
# [7,] "256" "724"
# [8,] "64" "181"
# [9,] "128" "362"
# [10,] "32" "181"
# [11,] "64" "724"
# [12,] "256" ">1024"
# [13,] "16" "362"
# [14,] "32" "181"
# [15,] "45" "724"
# [16,] "23" "362"
# [17,] "45" "724"
# [18,] "8" ">1024"
# [19,] "90" "362"
# [20,] "1024" ">1024"
# [21,] "90" "64"
# [22,] "23" "181"
# [23,] "32" "181"
# [24,] "45" ">1024"
# [25,] "512" "181"
工作原理
sapply
获取data.frame
并将逗号后指定的函数应用于data.frame
的每一列。 gsub
将模式替换为x
中的替换(data.frame
的一列)。在那里我使用了正则表达式,因此\\d
表示所有数字(0-9)和\\.
点和|
将它们与OR逻辑组合在一起。
<强> stringr溶液强>
stringr
有一个较短的解决方案:
library(stringr)
sapply(my_df,
function(x) str_c(str_extract(x, "[<>]?"),
round(as.numeric(str_extract(x, "\\d+")))))
这里我们想要的模式被提取,然后在舍入小数后再次组合。
数据强>
my_df <-
structure(list(X1 = structure(c(1L, 1L, 28L, 28L, 1L, 30L, 15L,
25L, 6L, 17L, 25L, 15L, 8L, 18L,
22L, 14L, 22L, 28L, 30L, 3L, 30L,
14L, 18L, 22L, 24L),
.Label = c("<8", ">1024", "1024", "11",
"11.000000000000007", "128",
"128.00000000000009", "16",
"16.000000000000007", "181",
"181.00000000000006", "22",
"23", "23.000000000000011",
"256", "256.00000000000017",
"32", "32.000000000000014",
"362", "362.00000000000017",
"45", "45.000000000000014",
"512", "512.00000000000045",
"64", "64.000000000000028",
"724", "8",
"8.0000000000000018", "90"),
class = "factor"),
X2 = structure(c(9L, 18L, 1L, 12L, 13L, 12L, 16L, 7L,
12L, 7L, 16L, 2L, 12L, 7L, 16L, 12L,
16L, 2L, 12L, 2L, 15L, 7L, 7L, 2L, 7L),
.Label = c("<8", ">1024", "1024", "11",
"128", "16", "181", "22", "23",
"256", "32", "362", "45", "512",
"64", "724", "8", "90"),
class = "factor")),
.Names = c("X1", "X2"),
row.names = c(NA, -25L),
class = "data.frame")
# X1 X2
# 1 <8 23
# 2 <8 90
# 3 8 <8
# 4 8 362
# 5 <8 45
# 6 90 362
# 7 256 724
# 8 64 181
# 9 128 362
# 10 32 181
# 11 64 724
# 12 256 >1024
# 13 16 362
# 14 32.000000000000014 181
# 15 45.000000000000014 724
# 16 23.000000000000011 362
# 17 45.000000000000014 724
# 18 8 >1024
# 19 90 362
# 20 1024 >1024
# 21 90 64
# 22 23.000000000000011 181
# 23 32.000000000000014 181
# 24 45.000000000000014 >1024
# 25 512.00000000000045 181