結果

問題 No.456 Millions of Submits!
ユーザー FF256grhyFF256grhy
提出日時 2016-12-08 00:12:50
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2,232 ms / 4,500 ms
コード長 23,086 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 34,368 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-05 08:39:36
合計ジャッジ時間 5,478 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,388 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 4 ms
4,376 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 24 ms
4,380 KB
testcase_10 AC 24 ms
4,376 KB
testcase_11 AC 224 ms
4,376 KB
testcase_12 AC 2,232 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cmath>

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define inc( i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec( i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

template<typename T> void swap(T & x, T & y) { T t = x; x = y; y = t; return; }
template<typename T> T abs(T x) { return (0 <= x ? x : -x); }
template<typename T> T max(T a, T b) { return (b <= a ? a : b); }
template<typename T> T min(T a, T b) { return (a <= b ? a : b); }
template<typename T> bool setmin(T & a, T b) { if(a <= b) { return false; } else { a = b; return true; } }
template<typename T> bool setmax(T & a, T b) { if(b <= a) { return false; } else { a = b; return true; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int m;

double table[11 * 11 * 11] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.105170918076, 2.718281828459, 7.389056098930, 20.085536923187, 54.598150033141, 148.413159102564, 403.428793492695, 1096.633158428330, 2980.957987041330, 8103.083927574166, 22026.465794803033, 1.371942701967, 2.718281828459, 4.113250378783, 5.652233674034, 7.389056098930, 9.356469016601, 11.582435190007, 14.094030107067, 16.918828678557, 20.085536923187, 23.624342922017, 1.590675682263, 2.718281828459, 3.525143165955, 4.230201256552, 4.891020886625, 5.528828489325, 6.154112717279, 6.772912375147, 7.389056098930, 8.005139901431, 8.623014125017, 1.754776196090, 2.718281828459, 3.284475962975, 3.728753565081, 4.113250378783, 4.460892156963, 4.783079471999, 5.086431792761, 5.375184131807, 5.652233674034, 5.919662339596, 1.879408960086, 2.718281828459, 3.154084737941, 3.475474232937, 3.741579733092, 3.973827203632, 4.182750653135, 4.374416596711, 4.552682257936, 4.720173577972, 4.878770261239, 1.976429766920, 2.718281828459, 3.072409319116, 3.323229181268, 3.525143165955, 3.697513201611, 3.849742082885, 3.987193317847, 4.113250378783, 4.230201256552, 4.339674162904, 2.053787548298, 2.718281828459, 3.016476757279, 3.221769725458, 3.383848442360, 3.520133625368, 3.638997901974, 3.745178381545, 3.841643203443, 3.930387834526, 4.012825049407, 2.116776069614, 2.718281828459, 2.975784592103, 3.149370811294, 3.284475962975, 3.396836458142, 3.493951759189, 3.580036897266, 3.657718361970, 3.728753565081, 3.794381546292, 2.168994470871, 2.718281828459, 2.944855468215, 3.095133266677, 3.210828615743, 3.306245231981, 3.388153002428, 3.460336425046, 3.525143165955, 3.584138029295, 3.638420522238, 2.212953911779, 2.718281828459, 2.920554403692, 3.052995299242, 3.154084737941, 3.236909262154, 3.307627611912, 3.369667396318, 3.425147078243, 3.475474232937, 3.521635145758, 0.100000000000, 1.000000000000, 2.000000000000, 3.000000000000, 4.000000000000, 5.000000000000, 6.000000000000, 7.000000000000, 8.000000000000, 9.000000000000, 10.000000000000, 1.095571918767, 1.763222834352, 2.345750754923, 2.857390783514, 3.327322322599, 3.768679463789, 4.188760119316, 4.592135677084, 4.981903247910, 5.360281110979, 5.728925565387, 1.317229009244, 2.020747358612, 2.462558947207, 2.810130444273, 3.108954763580, 3.376607438034, 3.622091177211, 3.850751085563, 4.066069332483, 4.270464978321, 4.465699904603, 1.500019854073, 2.166001755696, 2.523076342321, 2.786765067552, 3.004459286534, 3.193653031113, 3.363046598885, 3.517692436641, 3.660824028958, 3.794654474287, 3.920775117257, 1.643251546766, 2.260426288685, 2.560297497155, 2.772857716459, 2.943709597376, 3.089235776678, 3.217436749179, 3.332894041977, 3.438506412387, 3.536238685664, 3.627491785245, 1.757140681408, 2.326999960849, 2.585550167184, 2.763638862596, 2.904112666912, 3.022074631126, 3.124806126208, 3.216435617446, 3.299553942191, 3.375905013703, 3.446724693073, 1.849521272046, 2.376549639076, 2.603822444432, 2.757081660060, 2.876297120664, 2.975358918510, 3.060899268452, 3.136650527656, 3.204940558053, 3.267328034236, 3.324912467323, 1.925843761924, 2.414900124303, 2.617662950135, 2.752179606846, 2.855700390988, 2.941027379155, 3.014227330437, 3.078694469338, 3.136535585014, 3.189155530568, 3.237541744045, 1.989912745665, 2.445478652015, 2.628512185912, 2.748376595085, 2.839841377728, 2.914749791326, 2.978680287763, 3.034739257338, 3.084847378691, 3.130281172994, 3.171935283377, 2.044437894159, 2.470438346310, 2.637246560406, 2.745340440563, 2.827257062878, 2.893998176257, 2.950720105961, 3.000283117339, 3.044450097901, 3.084389522134, 3.120918367064, 2.091392731130, 2.491201867183, 2.644430198103, 2.742860525751, 2.817029672474, 2.877199736383, 2.928160379975, 2.972559920098, 3.012026284512, 3.047636051437, 3.080140455287, 0.316227766017, 1.000000000000, 1.414213562373, 1.732050807569, 2.000000000000, 2.236067977500, 2.449489742783, 2.645751311065, 2.828427124746, 3.000000000000, 3.162277660168, 1.088127127514, 1.531584393666, 1.824094932453, 2.046646065961, 2.232017752597, 2.393517404446, 2.538081377006, 2.669856048728, 2.791548217893, 2.905037573409, 3.011690771047, 1.280197978072, 1.763222834352, 2.016449685086, 2.198570919530, 2.345750754923, 2.471390992844, 2.582152284045, 2.681894249497, 2.773080141753, 2.857390783514, 2.936031008832, 1.439245548973, 1.913327998268, 2.137003362723, 2.292339209913, 2.415272017572, 2.518659978523, 2.608756477227, 2.689128500114, 2.762024592086, 2.828963591886, 2.891024917639, 1.567081480701, 2.020747358612, 2.221010017470, 2.356746954696, 2.462558947207, 2.550573865855, 2.626611828469, 2.693959689057, 2.754672859249, 2.810130444273, 2.861306923521, 1.671548825340, 2.102063280040, 2.283298940174, 2.403944332194, 2.496925923159, 2.573621570148, 2.639440479917, 2.697415776744, 2.749433291035, 2.796752206931, 2.840258531366, 1.758471406415, 2.166001755696, 2.331476928304, 2.440101859089, 2.523076342321, 2.591067065518, 2.649109275606, 2.700011147701, 2.745510964656, 2.786765067552, 2.824584467242, 1.831941104175, 2.217702875060, 2.369916577597, 2.468724834345, 2.543661837934, 2.604740306481, 2.656660329934, 2.702031922296, 2.742465044168, 2.779027493099, 2.812466244554, 1.894875271434, 2.260426288685, 2.401331600401, 2.491964396296, 2.560297497155, 2.615749672847, 2.662722030506, 2.703649992886, 2.740031521930, 2.772857716459, 2.802820429688, 1.949402891415, 2.296352274042, 2.427503425502, 2.511218448536, 2.574025666420, 2.624806777769, 2.667696140499, 2.704974878070, 2.738042690162, 2.767823780076, 2.794962161495, 1.997113113062, 2.326999960849, 2.449653281307, 2.527436742541, 2.585550167184, 2.632389869695, 2.671851649228, 2.706079670984, 2.736386924350, 2.763638862596, 2.788437653688, 0.464158883361, 1.000000000000, 1.259921049895, 1.442249570307, 1.587401051968, 1.709975946677, 1.817120592832, 1.912931182772, 2.000000000000, 2.080083823052, 2.154434690032, 1.082116057763, 1.419024454514, 1.611988094696, 1.750098618767, 1.860674310980, 1.954200554841, 2.035953411744, 2.109005555795, 2.175321484884, 2.236241854885, 2.292726902026, 1.252926354432, 1.622401683126, 1.797913356269, 1.918753915083, 2.013630402509, 2.092869593666, 2.161499453803, 2.222387104479, 2.277338213517, 2.327570941813, 2.373949802422, 1.394828316101, 1.763222834352, 1.924509645459, 2.032889199030, 2.116800605251, 2.186203979903, 2.245871633633, 2.298494037114, 2.345750754923, 2.388766820962, 2.428335902425, 1.510826493198, 1.869243146150, 2.018349198919, 2.116832509450, 2.192293367158, 2.254244734839, 2.307198890283, 2.353680844528, 2.395257600509, 2.432973681564, 2.467562897907, 1.607374633440, 1.952816575206, 2.091363675223, 2.181685346006, 2.250336373700, 2.306367858159, 2.354042174337, 2.395731648641, 2.432902164665, 2.466527309750, 2.497288933932, 1.689119514019, 2.020747358612, 2.150069847519, 2.233510585867, 2.296522615488, 2.347708660940, 2.391097660504, 2.428922688953, 2.462558947207, 2.492917213585, 2.520633793807, 1.759324517348, 2.077221595948, 2.198429314596, 2.275977523037, 2.334229075668, 2.381363282785, 2.421193923319, 2.455827749300, 2.486558648709, 2.514241587100, 2.539472694395, 1.820338144228, 2.125001473884, 2.239024299332, 2.311464314252, 2.365636770657, 2.409326391097, 2.446149800489, 2.478099318512, 2.506395802610, 2.531844429565, 2.555005689193, 1.873897053321, 2.166001755696, 2.273624216066, 2.341591066465, 2.392225866243, 2.432947917415, 2.467193543408, 2.496851322509, 2.523076342321, 2.546629178631, 2.568038535376, 1.921316684860, 2.201600001185, 2.303488595669, 2.367504594057, 2.415040204369, 2.453177208805, 2.485187018230, 2.512863977875, 2.537303750431, 2.559226786367, 2.579133296136, 0.562341325190, 1.000000000000, 1.189207115003, 1.316074012952, 1.414213562373, 1.495348781221, 1.565084580073, 1.626576561698, 1.681792830507, 1.732050807569, 1.778279410039, 1.077121211856, 1.350590586541, 1.493993893092, 1.593135705772, 1.670792691477, 1.735422360997, 1.791193839658, 1.840498783521, 1.884848071123, 1.925262565729, 1.962467234356, 1.231742610655, 1.531584393666, 1.665256779525, 1.754901494422, 1.824094932453, 1.881151543128, 1.930065683264, 1.973091728658, 2.011637524451, 2.046646065961, 2.078782420517, 1.360540729293, 1.661933991495, 1.787466590276, 1.870078344295, 1.933172608016, 1.984825163526, 2.028866446027, 2.067438998295, 2.101871681647, 2.133049694704, 2.161594487942, 1.467114454327, 1.763222834352, 1.881480802612, 1.958267772579, 2.016449685086, 2.063814305865, 2.104025575450, 2.139120804215, 2.170357715511, 2.198570919530, 2.224344453808, 1.556999830496, 1.845194742664, 1.956889377940, 2.028674430323, 2.082728261763, 2.126535560011, 2.163597168677, 2.195851286680, 2.224490323782, 2.250303279059, 2.273840917802, 1.634078491594, 1.913327998268, 2.019084224139, 2.086497659102, 2.137003362723, 2.177785003000, 2.212187536140, 2.242056615623, 2.268524641983, 2.292339209913, 2.314021165654, 1.701064513376, 1.971069971492, 2.071440729798, 2.134990458769, 2.182401407674, 2.220566556606, 2.252683896739, 2.280513171955, 2.305131693342, 2.327249369737, 2.347360001932, 1.759917972038, 2.020747358612, 2.116221400606, 2.176327773744, 2.221010017470, 2.256884529305, 2.287011764697, 2.313071955257, 2.336091840364, 2.356746954696, 2.375506558968, 1.812098710663, 2.064008381201, 2.155017406792, 2.212034175710, 2.254289644376, 2.288139163663, 2.316514955908, 2.341023737002, 2.362645782315, 2.382025202227, 2.399608915789, 1.858722395441, 2.102063280040, 2.188988822379, 2.243217287617, 2.283298940174, 2.315343816063, 2.342164766556, 2.365300522662, 2.385688607003, 2.403944332194, 2.420494211648, 0.630957344480, 1.000000000000, 1.148698354997, 1.245730939616, 1.319507910773, 1.379729661461, 1.430969081105, 1.475773161595, 1.515716566510, 1.551845573915, 1.584893192461, 1.072880129635, 1.303880649748, 1.417798902778, 1.494794459147, 1.554261721323, 1.603245626432, 1.645172328392, 1.681987954827, 1.714912364220, 1.744764465403, 1.772122597250, 1.214668603618, 1.467315502782, 1.575010510825, 1.645960677112, 1.700104748786, 1.744376041730, 1.782074386284, 1.815048932118, 1.844447778613, 1.871036174677, 1.895351535154, 1.333048460300, 1.588153353229, 1.690651078016, 1.757129904831, 1.807427705517, 1.848316200002, 1.882983905504, 1.913204291740, 1.940072242909, 1.964314238292, 1.986438556237, 1.431909794413, 1.684111835684, 1.781852997184, 1.844548342976, 1.891678211399, 1.929818615560, 1.962044829480, 1.990058896985, 2.014907552662, 2.037283134724, 2.057668744023, 1.516132198685, 1.763222834352, 1.856558571658, 1.915922261003, 1.960320821743, 1.996120558989, 2.026284046295, 2.052445005740, 2.075605264661, 2.096425879914, 2.115367188124, 1.589062014225, 1.830045201337, 1.919296213067, 1.975676656601, 2.017668906513, 2.051426911866, 2.079803540257, 2.104367554902, 2.126078767305, 2.145569312498, 2.163278673315, 1.653025705276, 1.887482950755, 1.972946933811, 2.026631447408, 2.066476656467, 2.098427653414, 2.125232014145, 2.148397115928, 2.168843501186, 2.187176500110, 2.203816397158, 1.709704348106, 1.937522414703, 2.019474377943, 2.070707453317, 2.108620244813, 2.138955750594, 2.164361351091, 2.186286648534, 2.205615522730, 2.222928434482, 2.238627946258, 1.760354639584, 1.981590028352, 2.060282423648, 2.109275659294, 2.145437669789, 2.174317759959, 2.198468444222, 2.219285073204, 2.237617311575, 2.254022523609, 2.268886878649, 1.805942222728, 2.020747358612, 2.096410894085, 2.143349360349, 2.177916586606, 2.205477291330, 2.228494425388, 2.248312450372, 2.265749093120, 2.281340242653, 2.295456875047, 0.681292069058, 1.000000000000, 1.122462048309, 1.200936955176, 1.259921049895, 1.307660486012, 1.348006154597, 1.383087554268, 1.414213562373, 1.442249570307, 1.467799267622, 1.069217714134, 1.269640931404, 1.364065361696, 1.426868393281, 1.474897109931, 1.514175320769, 1.547604478197, 1.576821154152, 1.602845517680, 1.626359299760, 1.647842086129, 1.200527510671, 1.419024454514, 1.509085224073, 1.567655916125, 1.611988094696, 1.648017911779, 1.678551127029, 1.705151795456, 1.728786887564, 1.750098618767, 1.769536604830, 1.310379216652, 1.531584393666, 1.618063005018, 1.673550392475, 1.715242818599, 1.748961989573, 1.777433989376, 1.802168666527, 1.824094932453, 1.843827333184, 1.861794737096, 1.402789758205, 1.622401683126, 1.705562748003, 1.758416686313, 1.797913356269, 1.829735302058, 1.856527686985, 1.879749294687, 1.900294641008, 1.918753915083, 1.935538049629, 1.482142325303, 1.698315165166, 1.778349537156, 1.828847742356, 1.866421122645, 1.896600809337, 1.921950491267, 1.943879587225, 1.963250202110, 1.980629977744, 1.996413460758, 1.551388004857, 1.763222834352, 1.840306486243, 1.888659563561, 1.924509645459, 1.953232064702, 1.977310062117, 1.998105478085, 2.016449685086, 2.032889199030, 2.047803354153, 1.612566380904, 1.819624307108, 1.893926614111, 1.940309460175, 1.974596557015, 2.002007682561, 2.024947762047, 2.044733045811, 2.062165784865, 2.077772644592, 2.091918760223, 1.667149817738, 1.869243146150, 1.940926597320, 1.985490563527, 2.018349198919, 2.044569667192, 2.066481361329, 2.085357049516, 2.101971431505, 2.116832509450, 2.130292135845, 1.716240844213, 1.913327998268, 1.982546918271, 2.025425645346, 2.056971634422, 2.082103917399, 2.103079475283, 2.121129735162, 2.137003362723, 2.151190809503, 2.164031486164, 1.760689395774, 1.952816575206, 2.019716260310, 2.061029048040, 2.091363675223, 2.115496363302, 2.135614936723, 2.152911593955, 2.168110416404, 2.181685346006, 2.193964126611, 0.719685673001, 1.000000000000, 1.104089513674, 1.169930812759, 1.219013654204, 1.258498950642, 1.291708342091, 1.320469247756, 1.345900192632, 1.368738106642, 1.389495494373, 1.066011722876, 1.243293119268, 1.323895391232, 1.376862123808, 1.417071403738, 1.449779845917, 1.477501068816, 1.501645445114, 1.523088509047, 1.542413343704, 1.560028946026, 1.188567936569, 1.381182211879, 1.458516815553, 1.508317274566, 1.545777780418, 1.576083985944, 1.601673863980, 1.623900977618, 1.643599439490, 1.661321711849, 1.677453660316, 1.291280208145, 1.486585669853, 1.561307159402, 1.608851948238, 1.644386736172, 1.673012740580, 1.697108326733, 1.717986400378, 1.736452529878, 1.753038444819, 1.768114484306, 1.378199079970, 1.572671772031, 1.644964019656, 1.690579157223, 1.724508840115, 1.751751533262, 1.774625416394, 1.794405337985, 1.811871223431, 1.827536649712, 1.841758597673, 1.453316858268, 1.645405494836, 1.715382073521, 1.759254650765, 1.791765192104, 1.817799002404, 1.839613188033, 1.858445568766, 1.875051762378, 1.889928444449, 1.903420321116, 1.519280561472, 1.708192051120, 1.775954905274, 1.818221958279, 1.849446051616, 1.874394513791, 1.895263481297, 1.913254722492, 1.929100581647, 1.943281747181, 1.956131421934, 1.577909347360, 1.763222834352, 1.828872383504, 1.869646920027, 1.899690133942, 1.923650084216, 1.943662875234, 1.960895352925, 1.976057572416, 1.989615041558, 2.001890113535, 1.630514218489, 1.812016281255, 1.875652042216, 1.915032566074, 1.943983865360, 1.967035628352, 1.986265424332, 2.002806434259, 2.017347402613, 2.030339414437, 2.042094566846, 1.678077349320, 1.855678739900, 1.917398209290, 1.955472869172, 1.983409629065, 2.005622060566, 2.024131036558, 2.040037404678, 2.054009568430, 2.066484912890, 2.077765831388, 1.721357296611, 1.895046217707, 1.954943751646, 1.991792470080, 2.018783228257, 2.040216557615, 2.058058662890, 2.073379417498, 2.086827833602, 2.098828286032, 2.109673981897, 0.749894209332, 1.000000000000, 1.090507732665, 1.147202690440, 1.189207115003, 1.222844544994, 1.251033404859, 1.275373106858, 1.296839554651, 1.316074012952, 1.333521432163, 1.063173690307, 1.222290429109, 1.292591463486, 1.338354900487, 1.372897691426, 1.400880878004, 1.424520653570, 1.445055405542, 1.463251424735, 1.479617685204, 1.494510394038, 1.178283903365, 1.350590586541, 1.418322080647, 1.461599190638, 1.493993893092, 1.520107920479, 1.542095523609, 1.561148913186, 1.578000874545, 1.593135705772, 1.606891031369, 1.274911757531, 1.449783322309, 1.515522947076, 1.557073908534, 1.587997526783, 1.612830972109, 1.633682231924, 1.651711856994, 1.667630391758, 1.681905985349, 1.694864177075, 1.357087130400, 1.531584393666, 1.595476023572, 1.635555579633, 1.665256779525, 1.689038497856, 1.708962460763, 1.726159880521, 1.741321512659, 1.754901494422, 1.767215055527, 1.428484983438, 1.601292718754, 1.663410541182, 1.702154659333, 1.730769794922, 1.753627809967, 1.772743272456, 1.789218760289, 1.803726222931, 1.816706721349, 1.828465990655, 1.491510807217, 1.661933991495, 1.722340080575, 1.759843766427, 1.787466590276, 1.809488723191, 1.827877261530, 1.843706699440, 1.857630856865, 1.870078344295, 1.881345941598, 1.547809238530, 1.715458838406, 1.774214698210, 1.810554797405, 1.837258613111, 1.858512652633, 1.876236842773, 1.891478240577, 1.904873160331, 1.916838295129, 1.927661911486, 1.598563103640, 1.763222834352, 1.820391071051, 1.855634452360, 1.881480802612, 1.902022765208, 1.919133858309, 1.933834460307, 1.946744006427, 1.958267772579, 1.968685910992, 1.644658348925, 1.806217358473, 1.861861098715, 1.896068037961, 1.921110668244, 1.940988726490, 1.957530393371, 1.971730208814, 1.984191363622, 1.995308199665, 2.005353129090, 1.686779858960, 1.845194742664, 1.899376702729, 1.932602468864, 1.956889377940, 1.976145968806, 1.992156352961, 2.005890120686, 2.017934854290, 2.028674430323, 2.038373876110, 0.774263682681, 1.000000000000, 1.080059738892, 1.129830963910, 1.166529039576, 1.195813174500, 1.220284935873, 1.241365817015, 1.259921049895, 1.276518007009, 1.291549665015, 1.060637698418, 1.205093768354, 1.267425999903, 1.307694379837, 1.337950311992, 1.362379896452, 1.382964392130, 1.400807246011, 1.416589479382, 1.430762464265, 1.443641521728, 1.169320222678, 1.325259650895, 1.385494368464, 1.423737593836, 1.452250990525, 1.475169672646, 1.494422710951, 1.511074905439, 1.525779352590, 1.538966923167, 1.550937539080, 1.260686909021, 1.419024454514, 1.477686616545, 1.514561363665, 1.541909812536, 1.563816149806, 1.582172418830, 1.598017993831, 1.611988094696, 1.624500612783, 1.635845760921, 1.338715051803, 1.496961454815, 1.554173731839, 1.589890193091, 1.616276846616, 1.637356603956, 1.654984958295, 1.670178024219, 1.683555310170, 1.695523576206, 1.706364843755, 1.406815780800, 1.563845438028, 1.619661169705, 1.654324515935, 1.679855263462, 1.700207798435, 1.717200289092, 1.731826140179, 1.744689931620, 1.756188039508, 1.766594944886, 1.467197773292, 1.622401683126, 1.676860679779, 1.710540562157, 1.735285277067, 1.754976377383, 1.771394227756, 1.785509846435, 1.797913356269, 1.808991204177, 1.819010730062, 1.521364072265, 1.674388457961, 1.727529454370, 1.760280560502, 1.784292539063, 1.803371894743, 1.819261154149, 1.832909318843, 1.844892464272, 1.855587475664, 1.865254863954, 1.570393370503, 1.721029739420, 1.772892930364, 1.804762363595, 1.828085873855, 1.846594136033, 1.861992171387, 1.875207422460, 1.886802327853, 1.897144551434, 1.906488052587, 1.615093099245, 1.763222834352, 1.813849842598, 1.844880118175, 1.867553765392, 1.885525824189, 1.900464411236, 1.913275943352, 1.924509645459, 1.934524290869, 1.943567547908, 1.656087668509, 1.801650690864, 1.851083935727, 1.881314317764, 1.903372718760, 1.920839402345, 1.935346366444, 1.947779589047, 1.958675514595, 1.968384351112, 1.977147725451, 0.794328234724, 1.000000000000, 1.071773462536, 1.116123174034, 1.148698354997, 1.174618943088, 1.196231198851, 1.214814044039, 1.231144413345, 1.245730939616, 1.258925411794, 1.058353426368, 1.190713610730, 1.246700333410, 1.282642712680, 1.309546625447, 1.331210951446, 1.349426872236, 1.365189249520, 1.379110775728, 1.391596821734, 1.402930150450, 1.161419072207, 1.303880649748, 1.358104480006, 1.392349906297, 1.417798902778, 1.438205477349, 1.455315818516, 1.470091679089, 1.483121918628, 1.494794459147, 1.505378986059, 1.248181236206, 1.392864761170, 1.445810982457, 1.478940168381, 1.503439699179, 1.523022303244, 1.539403755306, 1.553524858193, 1.565959729224, 1.577085586221, 1.587164109808, 1.322546036853, 1.467315502782, 1.519094757808, 1.551288061726, 1.575010510825, 1.593925763085, 1.609720033459, 1.623315244458, 1.635272738929, 1.645960677112, 1.655634072013, 1.387701074718, 1.531584393666, 1.582238716930, 1.613581694121, 1.636613142371, 1.654941640685, 1.670223235825, 1.683361450729, 1.694905518725, 1.705215171790, 1.714539300891, 1.445691286314, 1.588153353229, 1.637709825578, 1.668256124802, 1.690651078016, 1.708444325080, 1.723261227376, 1.735987111844, 1.747159453146, 1.757129904831, 1.766141547103, 1.497902489692, 1.638623877902, 1.687107562560, 1.716897754601, 1.738696570298, 1.755992477914, 1.770379947390, 1.782726318874, 1.793557587696, 1.803217593164, 1.811943834759, 1.545327159899, 1.684111835684, 1.731548951120, 1.760617349861, 1.781852997184, 1.798682118124, 1.812668373823, 1.824661390659, 1.835175959266, 1.844548342976, 1.853010659562, 1.588707543506, 1.725436539085, 1.771854891835, 1.800232325610, 1.820933371141, 1.837321757947, 1.850930646604, 1.862592287253, 1.872810552187, 1.881914360127, 1.890130632940, 1.628617625012, 1.763222834352, 1.808651482026, 1.836366509643, 1.856558571658, 1.872529227205, 1.885781610065, 1.897130982885, 1.907070598581, 1.915922261003, 1.923907875035
};

int main() {
	scanf("%d", &m);
	inc(i, m) {
		double a, b, t;
		scanf("%lf%lf%lf", &a, &b, &t);
		
		if(a == 0) {
			printf("%.12f\n", pow(2.718281828459, pow(t, 1.0 / b)));
		} else if(b == 0) {
			printf("%.12f\n", pow(t, 1.0 / a));
		} else {
			double n = table[ static_cast<int>(a * (11 * 11) + b * (11) + t) ];
			// printf("n = %.12f\n", n);
			inc(j, 30) {
				double v = pow(n, a) * pow(log(n), b) - t;
				double diff = v / (pow(n, a - 1) * (a * pow(log(n), b) + b * pow(log(n), b - 1)));
				n -= diff;
				if(abs(diff) < 6e-10) { break; }
				// printf("%2d %.12f\n", j, n);
			}
			printf("%.12f\n", n);
		}
	}
	
	return 0;
}
0