<?php
header("Access-Control-Allow-Origin: *");
class PathSprite{
public $m_parent;//父節點
public $m_child;//子節點
public $m_costToSource;//到起始點的距離
public $m_x;//地圖座標
public $m_y;
public $m_FValue;
public $m_startX;//開始點
public $m_startY;
public $m_endX;//結束點
public $m_endY;
}
class Map{
public $a;
public $width;
public $height;
public $m_inspectArray;
public $m_openList;
public $m_haveInspectList;
public $m_pathList;
public $start;
function __construct() {
// $this->a=file_get_contents("mapData.xml");
// $this->width=substr($this->a, 16,3);
// $this->height=substr($this->a, 29, 3);
// //echo substr($this->a, 46,$this->width*$this->height);
// $this->m_inspectArray = array(array());
// $this->m_haveInspectList = array();
// $this->m_openList = array();
// $this->m_pathList = array();
// $this->start=46;
// for($j=0;$j<$this->width;$j++){
// for($i=0;$i<$this->height;$i++){
// $index = $j * $this->height+$i;
// $str= substr($this->a, $index+$this->start,1);
// if($str==1){
// $PathSprite = new PathSprite();
// $PathSprite->m_x=$j;
// $PathSprite->m_y=$i;
// $this->m_inspectArray[$j][$i] = $PathSprite;
// }
// else
// {
// $this->m_inspectArray[$j][$i] = null;
// }
// }
// }
$dom = simplexml_load_file("mapData.xml");
$_domArray = $dom->attributes();
$this->data=$dom->data;
$this->width=$_domArray[0];
$this->height=$_domArray[1];
//echo substr($this->a, 46,$this->width*$this->height);
$this->m_inspectArray = array(array());
$this->m_haveInspectList = array();
$this->m_openList = array();
$this->m_pathList = array();
for($j=0;$j<$this->width;$j++){
for($i=0;$i<$this->height;$i++){
$index = $j * $this->height+$i;
$str= substr($this->data, $index,1);
if($str==1){
$PathSprite = new PathSprite();
$PathSprite->m_x=$j;
$PathSprite->m_y=$i;
$this->m_inspectArray[$j][$i] = $PathSprite;
}
else
{
$this->m_inspectArray[$j][$i] = null;
}
}
}
}
function getMinPathFormOpenList(){
if(count($this->m_openList)>0){
$sp = current($this->m_openList);
foreach ($this->m_openList as $row) {
if($sp->m_FValue > $row->m_FValue){
$sp=$row;
}
}
return $sp;
}else{
return null;
}
}
function removeObjFromOpenList($sprite)
{
if(!$sprite)
{
return false;
}
$key =0;
foreach ($this->m_openList as $row )
{
if($row === $sprite)
{
break;
}
$key++;
}
if ($key !== false)
{
array_splice($this->m_openList, $key, 1);
return true;
}
else
{
return false;
}
}
function getObjFromInspectArray($x,$y){
if($x >= 0 && $y >= 0 && $x < $this->width && $y < $this->height){
return $this->m_inspectArray[$x][$y];
}
return null;
}
function inspectTheAdjacentNodes($node,$adjacent,$endNode){
if($adjacent){
$x = abs($endNode->m_x-$adjacent->m_x);
$y = abs($endNode->m_y-$adjacent->m_y);
$F = null;
$G = null;
$H1 = null;
$H2 = null;
$H3 = null;
$adjacent->m_costToSource =$node->m_costToSource + $this->calculateTwoObjDistance($node,$adjacent);
$G = $adjacent->m_costToSource;
$H1 = $x + $y;
$F = $G + $H1;
$adjacent->m_FValue = $F;
$adjacent->m_parent = $node;
$this->m_haveInspectList[]=$adjacent;
$node->m_child = $adjacent;
$this->m_inspectArray[$adjacent->m_x][$adjacent->m_y] = null;
$this->m_openList[]=$adjacent;
}
}
function calculateTwoObjDistance($obj1,$obj2){
$x=abs($obj2->m_x - $obj1->m_x);
$y=abs($obj2->m_y - $obj1->m_y);
return $x + $y;
}
function clearPath(){
foreach ($this->m_haveInspectList as $row) {
# code...
$row->m_costToSource=0;
$row->m_FValue=0;
$row->m_parent=null;
$row->m_child=null;
$this->m_inspectArray[$row->m_x][$row->m_y] = $row;
}
unset($this->m_openList);
unset($this->m_pathList);
unset($this->m_haveInspectList);
}
function calculatePath($startX,$startY,$endX,$endY){
$startNode = $this->m_inspectArray[$startX][$startY];
$endNode = $this->m_inspectArray[$endX][$endY];
$startNode->m_costToSource = 0;
$startNode->m_FValue = 0;
$this->m_inspectArray[$startX][$startY] = null;
$this->m_haveInspectList[] = $startNode;
$this->m_openList[] = $startNode;
$node = null;
while(true){
$node = $this->getMinPathFormOpenList();
if(!$node){
break;
}
$this->removeObjFromOpenList($node);
$x=$node->m_x;
$y=$node->m_y;
if($x==$endX&&$y==$endY){
break;
}
$adjacent = null;
$adjacent = $this->getObjFromInspectArray($x+1,$y);
$this->inspectTheAdjacentNodes($node,$adjacent,$endNode);
$adjacent = $this->getObjFromInspectArray($x,$y-1);
$this->inspectTheAdjacentNodes($node,$adjacent,$endNode);
$adjacent = $this->getObjFromInspectArray($x-1,$y);
$this->inspectTheAdjacentNodes($node,$adjacent,$endNode);
$adjacent = $this->getObjFromInspectArray($x,$y+1);
$this->inspectTheAdjacentNodes($node,$adjacent,$endNode);
$adjacent = $this->getObjFromInspectArray($x+1,$y+1);
$this->inspectTheAdjacentNodes($node,$adjacent,$endNode);
$adjacent = $this->getObjFromInspectArray($x+1,$y-1);
$this->inspectTheAdjacentNodes($node,$adjacent,$endNode);
$adjacent = $this->getObjFromInspectArray($x-1,$y-1);
$this->inspectTheAdjacentNodes($node,$adjacent,$endNode);
$adjacent = $this->getObjFromInspectArray($x-1,$y+1);
$this->inspectTheAdjacentNodes($node,$adjacent,$endNode);
};
while($node){
$this->m_pathList[] = $node;
$node=$node->m_parent;
};
}
function pathFunction($s1, $s2, $e1, $e2){
$this->clearPath();
$this->calculatePath($s1,$s2,$e1,$e2);
$_array = array();
$_index=0;
while (!empty($this->m_pathList)) {
$_end = end($this->m_pathList);
//echo "x:".$_end->m_x." y:".$_end->m_y."<br/>";
$_child = array();
$_child['x'] = $_end->m_x;
$_child['y'] = $_end->m_y;
$_array[] = $_child;
array_pop($this->m_pathList);
$_index++;
};
$_arr = json_encode($_array);
echo $_arr;
}
}
if (isset($_GET['startx'])&&isset($_GET['starty'])&&isset($_GET['endx'])&&isset($_GET['endy']))
{
$_map = new Map();
$_map->pathFunction($_GET['startx'], $_GET['starty'], $_GET['endx'], $_GET['endy']);
}
?>
xml 地圖數據表,1代表能走的點
<MapData width="229" height="206">
<data>10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000110000001000000000000000000000000000000000000000011111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000111111111101100000000000000000000000000000000000011000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000011100000000110110000000000000000000000000000000001111111100001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000110000000000111110000000000000000000000000000000111000001110010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000001000000000000011110000000000000000000000000000011000000000110100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000010000000000000010100000000000000000000000000001100000000000011110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000001100000000000000011000000000000000000000000000011000000000000011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000011000000000000000110000000000000000000000000000100000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110000000000000000000000000000000000000111100000000000001100000000000000000000000000011000000000000001110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011100000000000000000000000000000000000001111100000000000111000000000000000000000000000110000000000000011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000000000000000000000000000000000011110000000000001110000000000000000000000000001100000000000001111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110000000000000000000000000000000000000101100000000000011100000000000000000000000000011100000000000010110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000001001000000000001111000000000000000000000000111110110000000000101101000000000000000000000000000000000000000000000000000000000000000000000000000000011100000000000000000100000000000000000000000000000000000000010011000000000011100000000000000000000000001100010010000000010111010000000000000000000000000000000000000000000000000000000000000000000000000000001000100000000000000001000000000000000000000000000000000000000010110000000001111000000000000000000000000010000010010000000101101100000000000000000000000000000000000000000000000000000000000000000000000000000100001000000000000000010000000000000000000000000000000000000000010100000000111100000000000000000000000001100000010011000010111010000000000000000000000000000000000000000000000000000000000000000000000000000010000001000000000000000100000000000000000000000000000000000000000110111111111110000000000000000000000000010000000010001101001101100000000000000000000000000000000000000000000000000000000000000000000000000000100000010000000000000001000000000000000000000000000000000000000001011111010111000000000000000000000000000100000000010000110111110000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000000000000010000000000000000000000000000000000000000010001001111100000000000000000000000000011111000000010001101111000000000000000000000000000000000000000000000000000000000000000000000000011000100000001000000000000000100000000000000000000000000000000000000000100001111111111000000000000000000000001110100000000100110111110000000000000000000000000000000000000000000000000000000000000000000000000101111100000010000000000000001000000000000000000000000000000000000000001001111111110000000000000000000000000011011000000000110101111000000000000000000000000000000000000000000000000000000000000000000000010001100011000000100000000000000010000000000000000000000000000000000000000010010011110100000000000000000000000001100110000000001110111110000000000000000000000000000000000000000000000000000000000000000000000100110101101000001001000000000000100000000000000000000000000000000000000000100111110101000001111100000000000000011001000000000011111111000000000000000000000000000000000000000000000000000000000000000000000011010101011010000010010000000000001000000000000000000000000000000000000000001001001011110000100000111000000000001100010000000000111111110000000000000000000000000000000000000000000000000000000000000000011100100111111111111111111100000000000010000000000000000000000000000000000000000010010010110110010000000010000000000101001100000000011111111000000000000000000000000000000000000000000000000000000000000000000101001000101101111111111001000000000000100000000000000000000000000000000000000000101001001101011111110000010000000001010011000000000111111110000000000000000000000000000000000000000000000000000000000000000010010111001111011111111110010000000000001000000000000000000000000000000000000000001010010101010010111011100100000000011000110000000011111111100000000000000000000000000000000000000000000000000000000000000000100111111111111111111111101100000000000010000000000000000000000000000000000000000011100110010100100101111111111111110110001100000001111111110000000000000000000000000000000000000000000000000000000000000000010011111111111111111111101011000000000000100000000000000000000000000000000000000000011001000110010110001111110111000001100011000000011111111100000000000000000000000000000000000000000000000000000000000000000100111111111111111111111111110000000000001000000000000000000000000000000000000000000110111111000110000010111111101111001000111111111110111110000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111110000000000010000000000000000000000000000000000000000001111000100000000000111111101110001101110100011010111111000000000000000000000000000000000000000000000000000000000000000000101111111111111111111111111111110000000000100000000000000000000000000000000000000000011110001000000000000000001111111111111111111111011111110000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111100000000001000000000000000000000000000000000000000000111100100000000000000000001111110111110010001101111111000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111000000000010000000000000000000000000000000000000000001101111000000000000000000011000111111111111111111111110000000000000000000000011111100000000000000000000000000000000000000111111111111111111111111111111110000000000100000000000000000000000000000000000000000011110010000000000000000000000000011111111111000111111000000000000000000000111111110000000000000000000000000000000000000010111111111111111111111111111111010000000001000000011110000000000000000000000000000000111101000000000000000000000000000011111111111111111110000000000000000011111111110000000000000000000000000000000000000000111111111111111111111111111111110010000000010000001000011000000000000000000000000000001101010000000000000000000000000000111111011111111111100000000000111111111001110000000000000000000000000000000000000000001111111111111111111111111111111100100000000100000010111111100000000000000000000000000011101000000000000000000000000000111111111011101111111000000000111111001001110000000000000000000000000000000000000000000011111111111111111111111111111111000100000001000001011011111110000000000000000000000000011100000000000000000000000000001111111101101111111101000001111000001111110000000000000000000000000000000000000000000000111111111111111111111111111111110001000000110000011100010010100000000000000000000000001110000000000000000000000000001100111111111111111111010000101100001111001000000000000000000000000000000000000000000000011111111111111111111111111111111100010000001000001110000100010100000000000000000000000011100000000000000000000000001100001111101001011111111110110110001111000100000000000000000000000000000000000000000000000111111111111111111111111111111111100010000000000011100001100010100000000000000000000000110000000000000000000000000100000100101100001111111110111111011110100110000000000000000000000000000000000000000000000001111111111111111111111111111111111000100000000000110000011100101000000000000000000000001111000000000000000000000010000001001110000011111111111000111110011101000000000000000000000000000000000000000000000000011111111111111111111111111111111010001000000000011100000110100110000000000000000000000111010000000000000000000001000000011111000000011111111011111010000011110000000000000000000000000000000000000000000000001111111111111111111111111111111110100010000000000110000000101001100000000000000000000011110100000000000000000000010000000111000000001101111110111111000000011000000000000000000000000000000000000000000000000010111111111111111111111111111111101000100000000001100000001001011000000000000000000001101101000000000000000000000111111110100000000010111111110011000000000111000000000000000000000000000000000000000000000000101111111111111111111111111111111010001000000000011000000010011110000000000000000000111101010000000000000000000000000000010000000001101011111101100000000000110000000000000000000000000000000000000000000000001011111111111111111111111111111101000010000000000110000000000011100000000000000000011101010100000000000000000000000000000100000000010100010001110100000000000110000000000000000000000000000000000000000000000011111111111111111111111111111111010001000000000001100000000001111000000000000000001111010101000000000000000000000000000110000000000110001100001101000000000000100000000000000000000000000000000000000000000001110111111111111111111111111111110100010000000000011000000000011111111111110000001111110101100000000000000000000000000001000000000010100010100011001000000000001100000000000000000000000000000000000000000000011110111111111111111111111111111001000100000000000110000000001011100000000011000011101111000000000000000000000000000000100000000000110001001000111101000000000001100000000000000000000000000000000000000000000111101111111111111111111111111010010001000000000001100000000111110000000000001101010011100000000000000000000000000000011000000000001000100010001011010000000000011100000000000000000000000000000000000000000001110011111111111111111111111110000100100000000000011000000001101100000000000001111100101000000000000000000000000000000100000000000110010000100010110010000000000011000000000000000000000000000000000000000000110100111111111111111111111111100001001000000000000010000000101110000000000000011111101100000000000000000000000000000010000000000001000100000011101010100000000000011000000000000000000000000000000000000000001111001111111111111111111111111000100100000000000000111111111110100000000000000011110110000000000000000000000000000001000000000000010010000000011101101000000000000011100011100000000000000000000000000000000011110111111111111111111111111100001001000000000000000111111100101000000000000001101101000000000000000000000000000000011100000000000100100000000011010110000000000001111111111000000000000000000000000000000000101001111011111111111111111111000100100000000000000000000010001010000000000000011011110000000000000000000000000000000000110000000010010000000000101100110000000111110110110000000000000000000000000000000000011110011111111101111111110111111111110000000000000000000000100010110000000000001110110000000000000000000000000000000000000010000000101000000000001001100100111111100001100010000000000000000000000000000000000111101111111111011111111011110100010000000000000000000000001000101100000000000110101000000000000000000000000000000000000000011000001010000000000010011101011000000000001100100000000000000000000000000000000010111111111111101111111110111010001000000000000000000000000100001001000000000001111100000000000000000000000000000000000000000001000011000000000000100010111100000000000011001000000000000000000000000000000000101110111111111011111111110100100010000000000000000000000001000001011000000000111111000000000000000000000000000000000000000000010001100000000000001000111111000000000000011010000000000000000000000000000000001010111111111111101111101100001001000000000000000000000000100000010011000000011011000000000000000000000000000000000000000000000010010000000000000010000101101000000000000001100000000000000000000000000000000101001111111111011011011101000010010000000000000000000000000000000100011100000100110000000000000000000000000000000000000000000000011100000000000000100111100110000000000000011000000000000000000000000000000001010011111111111011111101100000100100000000000000000000000000000001000010110001111000000000000000000000000000000000000000000000000010000000000000001010011000110000000000000110000000000000000000000000000000011000110111111111111110011000001010000000000000000000000000000000010000100011110100000000000000000000000000000000000000000000000001110000000000000011000111001100000000000000100000000000000000000000000000001100001111110111011101001010000010100000000000000000000000000000000010000110001101000000000000000000000000000000000000000000000000110010000000000000100000110011100000000000001000000000000000000000000000000000000011111111111011000011000000110000000000000000000000000000000000110000100101110000000000000000000000000000000000000000000000001000010000000000001000001110101100000000000010000000000000000000000000000000000001111111111011100000110000000000000000000000000000000000000000000100001101010100000000000000000000000000000000000000000000000110000110000000000101111010100101000000000001000000000000000000000000000000000000011110101111011000011000000000000000000000000000000000000000000000100001101001000000000000000000000000000000000000000000000001000000100000000011110010100100111000000000010000000000000000000000000000000000001011110011110110000110000000000000000000000000000000000000000000000110001110010110000000000000000000000000000000000000000000100000000100000000110010101000001010000000000100000000000000000000000000000000000011111100111001100001000000000000000000000000000000000000000000000000100011001001100000000000000000000000000000000000000000011000000001100000011111111111000001100000000001000000000000000000000000000000000000111110011110110000100000000000000000000000000000000000000000000000000100111110011000000000000000000000000000000000000000001100000000001000000111001111111000010100000000100000000000000000000000000000000000001111100111111100001000000000000000000000000000000000000000000000000000110101000110000000000000000000000000000000000000000010000000000001100001111111000100000011100000001000000000000000000000000000000000000111111001110111000110000000000000000000000000000000000000000000000000000101011001000000000000000000000000000000000000000000000000000000011100110000000001000000101000000100000000000000000000000000000000000001111110111111010001000000000000000000000000000000000000000000000000000001111001110000000000000000000000000000000000000000000000000000000011001100000000010000000111000001000000000000000000000000000000000000011111101111111000110000000000000000000000000000000000000000000000000000000110001100011000000000000000000000000000000000000000000000000000011111000000000100000000101000100000000000000000000000000000000000000111111111111010001100000000000000000000000000000000000000000000000000000001111101100101000000000000000000000000000000000000000000000000000011100000000001000000011010010000000000000000000000000000000000000011111111111110100110000000000000000000000000000000000000000000000000000000000010011101010000000000000000000000000000000000000000000000000000111000000000010000000101011000000000000000000000000000000000000000111111101111101001100000000000000000000000000000000000000000000000000000000000010101110100000000000000000000000000000000000000000000000000001110000000000100000001111100000000000000000000000000000000000000001111011011110010110000000000000000000000000000000000000000000000000000000000000010101111100000000000000000000000000000000000000000000000000011100000000001000000011010100000000000000000000000000000000000000011111100111100101100000000000000000000000000000000000000000000000000000000000000011001111000000000000000000000000000000000000000000000000001011000000000010000000011111000000000000000000000000000000000000001111110011010010110000000000000000000000000000000000000000000000000000000000000000011111110010000000000000000000000000000000000000000000000011011000000000100000000110110000000000000000000000000000000000000011111100110100101000000000000000000000000000000000000000000000000000000000000000000010101101100000000000000000000000000000000000000000000000100010000000001000000000111110000000000000000000000000000000000000111111011011001110000000000000000000000000000000000000000000000000000000000000000000011111011000000000000000000000000000000000000000000000011000100000000010000000000111100000000000000000000000000000000000011111100110110001000000000000000000000000000000000000000000000000000000000000000000000010101010000000000000000000000000000000000000000000001100001100000000100000000000110100000000000000000000000000000000000111111011111000010000000000000000000000000000000000000000000000000000000000000000000000011010100000000000000000000000000000000000000000000010000001111000001000000000001111000000000000000000000000000000000001110100110110001000000000000000000000000000000000000000000000000000000000000000000000000010111100000000000000000000000000000000000000000001100000001111000010000000000011111000000000000000000000000000000000101111001110100010000000000000000000000000000000000000000000000000000000000000000000000000111111000000000000000000000000000000000000000000010000000011111000100000000000111110000000000000000000000000000000001111110010101001000000000000000000000000000000000000000000000000000000000000000000000000001011110000000000000000000000000000000000000000001000000000011111001000000000001111100000000000000000000000000000000011111001110010010000000000000000000000000000000000000000000000000000000000000000000000000001111110000000000000000000000000000000000000000000000000000011110010000000000010111000000000000000000000000000000000111110011001001000000000000000000000000000000000000000000000000000000000000000000000000000001111100000000000000000000000000000000000000000000000000000011010100000000000101110000000000000000000000000000000001111000100010010000000000000000000000000000000000000000000000000000000000000000000000000000010111000110000000000000000000000000000000000000000000000000011111000000000001011100000000000000000000000000000000110110001000101000000000000000000000000000000000000000000000000000000000000000000000000000000101111001100000000000000000000000000000000000000000000000000100110000000000010111110000000000000000000000000000001111000111001100000000000000000000000000000000000000000000000000000000000000000000000000000000111110101000000000000000000000000000000000000000000000000000100110000000000111111100000000000000000000000000000011110001110011000000000000000000000000000000000000000000000000000000000000000000000000000000000111111010000000000000000000000000000000000000000000000000000111010000000001101011000000000000000000000000000001111100010110000000000000000000000000000000000000000000000000000000000000000000000000000000000001011110100000000000000000000000000000000000000000000000000000000110000001110001110000000000000000000000000000011010000101010000000000000000000000000000000000000000000000000000000000000000000000000000000000010111101000000000000000000000000000000000000000000000000000000000111011101100001110000000000000000000000000000111100010001010000000000000000000000000000000000000000000000000000000000000000000000000000000000011101111000000000000000000000000000000000000000000000000000000000111111100000011110000000000000000000000000011110000100010100000000000011110000000000000000000000000000000000000000000000000000000000000000000001011010000000000000000000000000000000000000000000000000000000000111000000000011111100000000000000000000000111100011000111100000000111111110000000000000000000000000000000000000000000000000000000000000000000001111100000000000000000000000000000000000000000000000000000000000000000000000111111000000000000000000000001111000111000111100001110111011110000000000000000000000000000000000000000000000000000000000000000000001111000000000000000000000000000000000000000000000000000000000000000000000011111111000000000000000000000111100001010001111000010111100001100000000000000000000000000000000000000000000000000000000000000000000010110000000000000000000000000000000000000000000000000000000000000000000000111111111000000000000000000001111000100010001010001010110000001100000000000000000000000000000000000000000000000000000000000000000000101110000000000000000000000000000000000000000000000000000000000000000000001111111111100000000000000000111110001000100001010111111100000001100000000000000000000000000000000000000000000000000000000000000000001001100000000000000000000000000000000000000000000000000000000000000000000011111111111100000000000000001111100100001000001111111011000000011000000000000000000000000000000000000000000000000000000000000000000010010100000000000000000000000000000000000000000000000000000000000000000000111111111111110000000000000101111001000010000011111101100000000101000000000000000000000000000000000000000000000000000000000000000000101101100000000000000000000000000000000000000000000000000000000000000000000111111111111110000000000001111110100000010000111101110000000001001000000000000000000000000000000000000000000000000000000000000000001101111000000000000000000000000000000000000000000000000000000000000000000001111111111111110000000000101111001000000100001111101100000000011010000000000000000000000000000000000000000000000000000000000000000000011101000000000000000000000000000000000000000000000000000000000000000000001111111111111100000000001111110100000001000011111110000000000010100000000000000000000000000000000000000000000000000000000000000000000011010000000000000000000000000000000000000000000000000000000000000000000011111111111111110000000101111110000000010000111111000000000000101000000000000000000000000000000000000000000000000000000000000000000000110010000000000000000000000000000000000000000000000000000000000000000000011111111111111110000001011110100000000110001110101000000000001110000000000000000000000000000000000000000000000000000000000000000000001010100000000000000000000000000000000000000000000000000000000000000000000011111111111111110000011111101000000001100011111010000000000001100000000000000000000000000000000000000000000000000000000000000000000010101000000000000000000000000000000000000000000000000000000000000000000000011111111111111100001011111100000000010100111110100000000000011000000000000000000000000000000000000000000000000000000000000000000000100110000000000000000000000000000000000000000000000000000000000000000000000001111111111111100011110110000000000101001111101000010000000110000000000000000000000000000000000000000000000000000000000000000000001001010000000000000000000000000000000000000000000000000000000000000000000000001111111111111001011111100000000001001101101010011100000001100000000000000000000000000000000000000000000000000000000000000000000010010100000000000000000000000000000000000000000000000000000000000000000000000001111111111111101111110000000000010001011011100111000000011000000000000000000000000000000000000000000000000000000000100000000000101101100000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111000000000010100010110111001010000000110000000000000000000000000000000000000000000000000000000001100000000001011011000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111100000000000011111111101110010100000001100000000000000000000000000000000000000000000000000000000001000000000011011110000000000000000001100000000000000000000000000000000000000000000000000000000111111111111111000000000000010000001011100101000000011000000000000000000000000000000000000000000000000000000000001000000000000111110000000000000000011111010000000000000000000000000000000000000000000000000000111111111111110000000000000100000011111011010000001100000000000000000000000000000000000000000000000000000000000001000000000001111100000000000000000111110100000000000000000000000000000000000000000000000000000111111111111100000000000001000000101011111111111111100000000000000000000000000000000000000000000000000000000000011000000000011111000000000000001111111001000000000000000000000000000000000000000000000000000001111111111111000000000010010000000010111101111111111000000000000000000000000000000000000000000000000000000000000011000000000111110000000000000011111111110000000000000000000000000000000000000000000000000000001111111111100000000000100100000000101111100000001110000000000000000000000000000000000000000000000000000000000000011000000001111110000000000000110110011100000100000000000000000000000000000000000000000000000001111111111000000000001001000000001011111000000011100000000000000000000000000000000000000000000000000000000000000010000000011101110000000000011111000010000001000000000000000000000000000000000000000000000000001111111110000000000010010000000010110110000000111000000000000000000000000000000000000000000000000000000000000000100000000101011100000000001111110000111011010000000000000000000000000000000000000000000000000001111111100000000000100100000000101101100000010110000000000000000000000000000000000000000000000000000000000000001110000001010011000000001110010000001011110100000000000000000000000000000000000000000000000000011111111111110000001001000000000011011000000101100000000000000000000000000000000000000000000000000000000000000111110000010100110000000111101000000010011001000000000000000000000000000000000000000000000000000111111111111111000010010000000000110110000001011000000000000000000000000000000000000000000000000000000000000011000110000101100110000001110100000000100011110110000000000000000000000000000000000000000000000001111111111111111111101000000000001101100000010110000000000000000000000000000000000000000000000000000000000011100111110001101001100000011001000000001011111101100000000000000000000000000000000000000000000000111111111011111111111110000000000011010000000101100000000000000000000000000000000000000000000000000000000001110111000100011010001000001111100000000011000001110010000000000000000000000000000000000000000000001111111110000000000110000000000000110100000010101000000000000000000000000000000000000000000000000000000001100110000001100110100011000111100000000000000000011100100000000000000000000000000000000000000000000111111111100000000001100000000000001101000000101010000000000000000000000000000000000000000000000000000001100001000000001001101000010001110000000000000000000011111000000000000000000000000000000000000000000001111111110000000000011000000000000011010000001010100000000000000000000000000000000000000000000000000000110000010000000010101010000110111100000000000000000001111100000000000000000000000000000000000000000000111111111100000000000110000000000001110100000010101000000000000000000000000000000000000000000000000000011000000100000000011010100000111111000000000000000000001101100000000000000000000000000000000000000000001111111111000000000001100000000000011101000000101010000000000000000000000000000000000000000000000000000000000001100000000110101000001101100000000000000000000001110100000000000000000000000000000000000000000111111111100000000000011000000000000111010000011010100000000000000000000000000000000000000000000000000000000000011000000000101010000011100000000000000000000000001111010000000000000000000000000000000000110011111111111000000000000110000000000001101000000100110000000000000000000000000000000000000000000000000000000000000011000000001100100001011000000000000000000000000001111110100000000000001100000000000000001100111111111100000000000001000000000000011010011111001100000000000000000000000000000000000000000000000000000000000000110000000011001000100110000000000000000000000000011111101000000000000011000000000000000011011111111111000000000000110000000000000110100110110110000000000000000000000000000000000000000000000000000000000000000100000000111010001010010000000000000000000000000111010110000000000000100000000000000000110111111111100000000000001000000000000001000110111111000000000000000000000000000000000000000000000000000000000000000000100000001010100100100000000000000000000000000001110101110100000011011000000000000000011111111111110000000000000010000000000000010000111111110000000000000000000000000000000000000000000000000000000000000000001000000010010010010000000000000000000000000000000111110111000000111110000100000000001111111111111100000000000001100000000000000101011111111100000000000000000000000000000000000000000000000000000000000000000011100000100111100100000000000000000000000000000000111111100000001111100011000000000011111111111111111100000000010000000000000001010111110110000000000000000000000000000000000000000000000000000000000000000000010100011011111110000000000000000000000000000000000111111110100011110100110010000001011111111111111100100000011000000000000000010110111011000000000000000000000000000000000000000000000000000000000000000000000101111111101111100000000000000000000000000000000000110110111110111111110100100000100111111111110101101000001100000000000000000111111111110000000000000000000000000000000000000000000000000000000000111110000000110010110111111010000000000000000000000000000000000111100110111101011100111000001001111110101111111111011100000000000000000001111111101100000000000000000000000000000000000000000000000000000000011100011000000111101010011101100000000000000000000000000000000000011111111100011111110010000111111111110011100111111100000000000000000000011111110011000000000000000000000000000000000000000000000000000000111100000111000000011110100001011000000000000000000000000000000000000111111110000000011111111111011111110000111001111100000000000000000000000110111110110000000000000000000000000000000000000000000000000000000011111111011110011111010000011110000000000000000000000000000000000000000100100000000000111111111111111000001111111111000000000000000000000001111111101100000000000000000000000000000000000000000000000000000001101111101111111111111110000011100000000000000000000000000000000000000000110000000000000011011111111000000011011111111000000000000000000000011111111010000000000000000000000000000000000000000000000000000000010001111111101100111111111000111000000000000000000000000000000000000000000000000000000000011110111110000000110001110111111111111111000000011111111111100000000000000000000000000000000000000000000000000000001000000000111011001111000001101110000000000000000000000000000000000000000000000000000000000001111111100000000100111111111111111111110000001111111111110000000000000000000000000000000000000000000000000000000010000000001101010011110000000111100000000000000000000000000000000000000000000000000000000000011111111000000001111111011111111111111111111111111111111100000000000000000000000000000000000000000000000000000000100000000001010100111000000000111000000000000000000000000000000000000000000000000000000000001101011110000000010001110100000000000001111111111111111111000000000000000000000000000000000000000000000000000000001000000000011001001110000000001110000000000000000000000000000011111100000000000000000000000000011111100000001000011101000000000000011111111111111111110000000000000000000000000000000000000000000000000000000010000000000110010000100000000011100000000000000000000000000011111111100000000000000000000000001111111000000010001111010000000000000001111111111011111110000000000000000000000000000000000000000000000000000000010000000001100100001000000000111000000000000000000000000001010000001100000000000000000000000011111010001000100011110100000000000001111111111111111111100000000000000000000000000000000000000000000000000000000100000000011010000010000000000110000000000000000000000000011000000001100000000000000000000000111111000100001000111101111110000000000000100110111111111000000000000000000000000000000000000000000000000000000001000000000111000000100000000001100000000000000000000000000110000000011000000000000000000000001111110001000010001111110000011100000000000100111111111110000000000000000000000000000000000000000000000000000000010000000001100000001000000000011100000000000000000000000010100000000110000000000000000000000011111000110000100010111000000001100000000000111101111111100000000000000000000000000000000000000000000000000000000100000000011000000010000000000110100000000000000000000000101000000001100000000000000000000000111110001100001000101110000000011000000000000011011111111000000000000000000000000000000000000000000000000000000000100000001010000000100000000000111000000000000000000000001110000000011000000000000000000000001111100101000010001011000000000110000000000000111011111110000000000000000000000000000000000000000000000000000000001100000010100000001000000000011111000000000000000000000011100000000110000000000000000000000011010010001000100011110000000001100000000000001110111111100000000000000000000000000000000000000000000000000000000000000000101000000010000000001100110000000000000000000000011000000001100000000000000000000000111101000010001000111000000000011000000000000001101111111000000000000000000000000000000000000000000000000000000000000000001010000000100000000100001100000000000000000000001110000000011000000000000000000000001111100000010010011100000000000110000000000000001011101110000000000000000000000000000000000000000000000000000000000000000010100000001000000110000011000000000000000000000011010000000110000000000000000000000011111000000010111010000000000000100000000000000001111011000000000000000000000000000000000000000000000000000000000000000000101000000010000010000000110000000000000000000000011111000001100000000000000000000001111110000000011101100000000000001100000000000000011110110000000000000000000000000000000000000000000000000000000000000100001010011000100001000000001100000000000000000000001111111000011000000000000000110000111101100000111011111100000000000011000000000000001111111100000000000000000000000000000000000000000000000000000000000001100010101001001000100000000111000000000000000000000011111111000111000000000001111111111111110000010000111111000000000000110000000000001111000110111111110000000000000000000000000000000000000000000000000000000110101010010010010000000001110000000000000000000000111101110011100000000001111011111110111100011000010011110000000000001100000000001110001001101001111110000000000000000000000000000000000000000000000000000000011010100100101000000000101100000000000000000000011101111110111000000000101111111111000001111000000100011100000000000111100000001111100001011011100000100000000000000000000000000000000000000000000000000000000001101001001100000000001111000000000000000000000101111001111110100000010111101110010000101101100001000111000000000011000111111111111000010110100000001111000000000000000000000000000000000000000000000000000000011010010010000000000011110000000000000000000001100000001011011000001011111111000100001110000111110001111000000000110000011000101110000011101000000010010000000000000000000000000000000000000000000000000000000111100100100001000000110100000000000000000000111000000001110111111101011111000001000011000000000111111111100100010100001100010011100000011110000000100100000000000000000000000000000000000000000000000000000001011111011000110000001101000000000000000000001110000000011111110111101111000000010000110000000001000111101111111001001100001000110000000111000000001001000000000000000000000000000000000000000000000000000000001111110110001100000011010000000000000000000011100000000011111110110011100000000100010100000000100001111000011000010110000100001100000011110000000010010000000000000000000000000000000000000000000000000000000010111111100110000000110100000000000000000001101000000000111111111111100000000001000101000000001110011110000001000111000110000011000000110100000000010100000000000000000000000000000000000000000000000000000000100110111001100000011110000000000000000000011010000000001111111101100000000000010010010000000000100111100000001101100110000001110000001101000000000101000000000000000000000000000000000000000000000000000000001001101111110000000110100000000000000000000111000000000011111111111000000000000100100010000000000101111000000000111110000000011100000011010000000001010000000000000000000000000000000000000000000000000000000010011011011100000001110000000000000000000001110000000000111101111000000000000000110000100000000001010110000000001100000000000111000000111000000000010100000000000000000000000000000000000000000000000000000000100100100110000000011000000000000000000000011100000000001111111100000000000000000000000100000000010101100000000010000000000001100000001110000000000101000000000000000000000000000000000000000000000000000000001001001001111111111000000000000000000000001111000000000111111011100000000000000000000000100000000101111000000000100000000000011000000011100000000001010000000000000000000000000000000000000000000000000000000001010010010000000010000000000000000000000011101000000001111111101100000000000000000000000100000000111110000000001000000000001110000000111000000000010100000000000000000000000000000000000000000000000000000000010101100100000001000000000000000000000000111001110011111111111101000000000000000000000001111111111111100000000010000000000011100000001110000000000101000000000000000000000000000000000000000000000000000000000111110011000111110000000000000000000000001111111111111111111111110000000000000000000000001000000111111000000000110000000000110000000011100000000001110000000000000000000000000000000000000000000000000000000001100100110001111000000000000000000000000011111000001101111101111111000000000000000000000011000000011110000000001100000000001100000000011000000000011000000000000000000000000000000000000000000000000000000000111111111111100010000000000000000000000001111100000000111110011111000000000000000000000000100000000110100000000011000000000011000111111110000000001100000000000000000000000000000000000000000000000000000111110110011010000001000000000000000000000000011110000000000110100001110000000000000000000000001000000001101100000000110110000000100110111111111111111110000000000000000000000000000000000000000000000000000110000001111110100000100000000000000000000000000111100000000001110000000100000000000000000000000010000000011111110001111111011000001111110000011011000001100000000000000000000000000000000000000000000000000110000000011111101000001000000000000000000000000011111000000000011100000001000000000000000000000000100000000110111000100110111011000010110000000110001111110000000000000000000000000000000000000000000000000000000000000111101010000100000000000000000000000000111100000000000111000000010000000000000000000000001000000000110011111110110101010001111000000001100000000000000000000000000000000000000000000000000000000000000000000001111010100010000000000000000000000000001111000000000011100000000110000000000000000000000010000000001100001000000101010011111100000000000000000000000000000000000000000000000000000000000000000000011000000000011010101001000000000000000000000000000011110000000001011000000001100000000000000000000000100000000001000100000001001101110110000000000000000000000000000000000000000000000000000000000000000000000100000000000110101100100000000000000000000000000000111100000000010110000000011000000000000000000000001000000000010011000000001001100011000000000000000000000000000000000000000000000000000000000000000000000001000000000001111011110000000000000000000000000000001110000000000101000000001110000000000000000000000010000000000101100000000010110000010000000000000000000000000000000000000000000000000000000000000000000000010000000000011100100000000000000000000000000000000111100000000001110000000011100000000000000000000000100000000001010000000000011000000010000000000000000000000000000000000000000000000000000000000000000000000100000000000111001000000000000000000000000000000001111000000000011100000000111000000000000000000000001000000000001000000000001010000000100000000000000000000000000000000000000000000000000000000000000000000001000000000001110010000000000000000000000000000000011011000000001110000000010110000000000000000000000001000000000001000000000010000000000100000000000000000000000000000000000000000000000000000000000000000000010000000000101000100000000000000000000000000000000110001111111111100000000101100000000000000000000000010000000000001000000001000000000001000000000000000000000000000000000000000000000000000000000000000000000010000000001110001000000000000000000000000000000001000000000000011111111111111000000000000000000000000110000011111110000000010000000000010000000000000000000000000000000000000000000000000000000000000000000000010000000011110010000000000000000000000000000000010000000000000111111111111100000000000000000000000001011111100001110000000100000000000100000000000000000000000000000000000000000000000000000000000000000000000111100000101100100000000000000000000000000000000000000000000000111111111111110000000000000000000000010000000000000100000001000000000000100000000000000000000000000000000000000000000000000000000000000000000000000111111111001000000000000000000000000000000000000000000000000001111111100000000000000000000000000100000000000001100000100000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000110110100000000000000000000000000000000000000000000000000000000110000000000000000000000000001000000000000001100001000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000001101101000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000100000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000011111010000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000011001000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000111110100000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000010100000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000001111101000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000111100000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000011110100000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000110000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000110001000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000001100000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000001111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000011000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000101100000000011000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000010000111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</data>
</MapData>