QOJ.ac

QOJ

Süre Sınırı: 3 s Bellek Sınırı: 2048 MB Toplam puan: 100

#8682. 水世界

İstatistikler

近年嚟,人類發現咗幾千粒太陽系以外嘅行星。有冇液態水,係能否支持生命嘅一個重要因素。要喺遙遠行星上偵測水並唔容易。對於會自轉嘅行星,一種運用相對論量子偏振光譜學嘅全新技術可以幫手。佢嘅運作方式如下(呢個係簡化版描述,因為地球上只有三個人明白佢真正點樣運作)。

假設望遠鏡顯示嘅行星影像入面,自轉軸係垂直嘅,赤道係水平嘅。只會分析影像正中心嘅垂直線(同自轉軸重合嗰條線),因為佢提供行星表面最高嘅解像度。

分析以每步 $d$ 度進行。每一步會喺行星自轉 $d$ 度期間彙集數據,所以每一步都提供行星表面一個 $d$ 度切片嘅資料。影像會分成 $n$ 段高度相同嘅區段,分開分析。因此呢個 $d$ 度切片會分成 $n$ 個區域 $A_1,\ldots,A_n$。對每個區域 $A_i$,影像分析會產生一個數字,表示 $A_i$ 被水覆蓋嘅百分比。右圖標示咗其中一步嘅各個區域 $A_i$。

problem_8682_2139e876b51353495856aca74a78657b.png

你可以假設行星表面係球面。即係每個區域 $A_2,\ldots,A_{n-1}$ 都係球面四邊形:有四個頂點,兩條邊平行赤道(即係喺平行於赤道平面嘅平面上),另外兩條邊喺經過行星兩極嘅大圓上,而呢啲大圓相隔 $d$ 度。喺任何一個極點,四個頂點入面有兩個會重合喺極點,所以 $A_1$ 同 $A_n$ 係只有一條邊平行赤道嘅球面三角形。因為表面有曲率,平行赤道嘅邊越近赤道就越長,而喺大圓上嘅邊越近兩極就越長。

之後對再自轉嘅 $d$ 度重複上述過程,如此類推,一共做 $m$ 次,直到覆蓋行星成個表面(即係 $md=360$ 度)。你嘅任務係根據畀定嘅數據,計算行星表面被水覆蓋嘅百分比。

輸入格式

輸入第一行有兩個整數 $n$ 同 $m$($2 \le n,m \le 1000$)。之後 $n$ 行,每行有 $m$ 個整數 $a_{i,j}$(對於 $1 \le i \le n$ 同 $1 \le j \le m$,有 $0 \le a_{i,j} \le 100$)。呢個矩陣每一列描述一步嘅量度結果,即係自轉 $d$ 度嘅量度。數字 $a_{i,j}$ 係第 $j$ 步嗰陣,區域 $A_i$ 被水覆蓋嘅百分比。

輸出格式

輸出行星表面被水覆蓋嘅百分比。答案嘅絕對誤差最多係 $10^{-6}$。

樣例

輸入格式 1

3 7
63 61 55 54 77 87 89
73 60 38 5 16 56 91
75 43 11 3 16 20 95

輸出格式 1

51.809523810

輸入格式 2

4 3
10 10 10
10 10 10
10 10 10
10 10 10

輸出格式 2

10.000000000

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.